Commit Graph

30 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
868bd149f5 PEP8 2015-04-16 19:24:32 +02:00
Jeppe Klitgaard
69d7e74464 Removed useless commented code. 2015-04-16 19:22:57 +02:00
Jeppe Klitgaard
026a410208 Added tests for Double datatype 2015-04-16 19:22:17 +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
4e6f223a7d Fixed 3 of the VALID_VALUES on the
UnsignedIntegerTest not being bytes.

Added Long and UnsignedLong tests.
2015-04-16 15:59:18 +02:00
Jeppe Klitgaard
5eddb67489 Removed non-empty string deserialization test, as
strings and bytes are the same on python2.

Fixed a non PEP8-compliant space.

Added tests for Integer and UnsignedInteger datatypes.
2015-04-16 15:49:43 +02:00
Jeppe Klitgaard
83a2fdce00 Merge branch 'dev' into new_types 2015-04-16 09:20:05 +02:00
Jeppe Klitgaard
89a4368c1e Added tests for compat.py 2015-04-16 09:12:26 +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
8ca5c7f35f Abstraction in exceptions tests 2015-04-14 19:45:15 +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
6daca43748 Added tests for YggdrasilError 2015-04-07 20:16:01 +02:00
Jeppe Klitgaard
ca81f7685a Moved tests around for more logical order. Made tests for Profile object. 2015-04-07 20:07:47 +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
a073ee35d8 Add more encryption tests 2015-04-03 07:19:46 +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
4fe5caa7d9 Added an easy encryption test 2015-04-02 22:02:47 +05:00
Jeppe Klitgaard
c34d30566f Made some tests for authentication. Still many tests to be made 2015-04-02 00:11:14 +02:00
Jeppe Klitgaard
4a38e6fe3d Added the first test, yay 2015-04-01 17:40:40 +02:00