forked from ammaraskar/pyCraft
-
Notifications
You must be signed in to change notification settings - Fork 1
New types #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New types #7
+831
−22
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…me in handy later
…me in handy later
…which types should be allowed. This was done to handle bool being a subclass of int
* 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?
strings and bytes are the same on python2. Fixed a non PEP8-compliant space. Added tests for Integer and UnsignedInteger datatypes.
UnsignedIntegerTest not being bytes. Added Long and UnsignedLong tests.
Implemented compatibility layer for the long type (has been removed in py3) Added test for long-type compat.
This required the implementation of a new method on BaseDatatypeTester. dynamic_assert_equal is overridden by floating point datatypes, and instead uses TestCase.assertAlmostEqual.
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ammaraskar#140