Commit Graph

33 Commits

Author SHA1 Message Date
Jeppe Klitgaard
55ff270f16 Tests for VarInt
Removed unused import (SerializationError)

We now check if Datatype.SIZE is a number using ABC.

Added 2 decorators for raising serialized and deserialized data
exceptions.

Datatype.SIZE can now be either a number or a sequence. If sequence,
first value is MIN_SIZE and second value is MAX_SIZE

VarInt.serialize now raises ValueError instead of SerializationError
when number is too big to serialize.
2015-04-16 23:38:02 +02:00
Jeppe Klitgaard
e1f8f0254a Ignored python2-specific code on coverage report. 2015-04-16 20:22:49 +02:00
Jeppe Klitgaard
20e7c70acf Implemented tests for the Float datatype.
This required the implementation of a new method on BaseDatatypeTester.

dynamic_assert_equal is overridden by floating point datatypes, and
instead uses TestCase.assertAlmostEqual.
2015-04-16 18:49:23 +02:00
Jeppe Klitgaard
cc184f3e4d Added tests for LongLong and UnsignedLongLong.
Implemented compatibility layer for the long type (has been removed in
py3)

Added test for long-type compat.
2015-04-16 17:05:44 +02:00
Jeppe Klitgaard
474aa5858a Merge remote-tracking branch 'origin/six' into new_types 2015-04-16 16:52:13 +02:00
Jeppe Klitgaard
ab4d78dc53 Started using six 2015-04-16 16:43:14 +02:00
Jeppe Klitgaard
83a2fdce00 Merge branch 'dev' into new_types 2015-04-16 09:20:05 +02:00
Jeppe Klitgaard
a31f1c543f More datatype abstraction:
* NumberDatatype
* StringDatatype

_raise_serialization_value_error_data is now a classmethod instead of a classmethod.

Tests for MIN and MAX number values of NumberDatatypes have been made more abstract.

TEST_DATA_* has been removed from variable names. Sometimes it can get a little too rediculous with these var-names, don't you think?
2015-04-16 09:02:54 +02:00
Jeppe Klitgaard
73b990cc81 Added DISALLOWED_SERIALIZATION_TYPES, making it easier to cherrypick which types should be allowed. This was done to handle bool being a subclass of int 2015-04-14 20:06:53 +02:00
Jeppe Klitgaard
bac87695ff Implemented some of the datatypes and some tests for them. 2015-04-14 19:49:11 +02:00
Jeppe Klitgaard
a589c1e61f Added exceptions for serialization and deserialization. These will come in handy later 2015-04-14 19:45:15 +02:00
Ammar Askar
a5a76a8e1c Added more tests, fixed compat.py to run on py3 as well 2015-04-12 07:26:12 +05:00
Jeppe Klitgaard
971506533c id is a reserved name, even as an attribute. We now use id_ instead 2015-04-06 15:44:51 +02:00
Jeppe Klitgaard
fde8286e7e Things look slightly more legit... 2015-04-06 15:27:42 +02:00
Jeppe Klitgaard
9f93c67fb6 pylint needed a hand to inspect compat.py 2015-04-06 02:21:50 +02:00
Jeppe Klitgaard
ce19872115 start.py fixed, added compat.py 2015-04-06 02:11:26 +02:00
Jeppe Klitgaard
17e89f23c8 Fixed typo, explicitly stated that number was status code. 2015-04-05 22:14:38 +02:00
Ammar Askar
5d56162300 Quick little base test for connection 2015-04-03 22:04:45 +05:00
Ammar Askar
ea11461e76 Fully test the encryption package, and add a test for uncompressed packets when packet compression is enabled 2015-04-03 21:30:31 +05:00
Ammar Askar
1249f99a1e Packet tests 2015-04-03 08:51:53 +05:00
Ammar Askar
08e126188a Add a serialization test 2015-04-03 08:06:20 +05:00
Ammar Askar
d3917b42a4 split up pylint into errors and warning runners 2015-04-03 03:13:22 +05:00
Ammar Askar
c353d8bb86 Address more pylint and py3 compatibility problems 2015-04-03 02:25:34 +05:00
Ammar Askar
dcb2845ac4 Fix some pylint concerns 2015-04-03 01:44:03 +05:00
Ammar Askar
f7ed4da0d0 Platform independent manifest verification 2015-04-02 23:43:03 +05:00
Ammar Askar
4fe5caa7d9 Added an easy encryption test 2015-04-02 22:02:47 +05:00
Ammar Askar
b37c095039 Fix connection to work with new authentication module 2015-04-02 22:02:08 +05:00
Jeppe Klitgaard
c1e7960165 Finished up authentication.py, I hope. Still needs tests and documentation 2015-04-02 00:09:52 +02:00
Jeppe Klitgaard
6cf6110bc5 Updated authentication.py and made it work with the rest of pyCraft 2015-04-01 23:38:10 +02:00
Jeppe Klitgaard
8e40122c24 Moved authentication out of networking submodule. 2015-04-01 17:43:16 +02:00
Jeppe Klitgaard
3cb922310a Setup.py and versioning 2015-04-01 17:38:14 +02:00
Jeppe Klitgaard
59a5fe1285 Merge remote-tracking branch 'origin/master' into jeppes_initial_work 2015-04-01 17:22:05 +02:00
Jeppe Klitgaard
bb94d99bd4 Moved code into a python module 2015-04-01 17:19:12 +02:00