Commit Graph

11 Commits (81550cab92aaacbca5db0d37c607dfd1707ce4c3)

Author SHA1 Message Date
Michael Chisholm 2cda97cf5e Changed STIX object initialization to formulate a property order
and process properties in that order.  This establishes iteration
order on object properties, making the object_properties() method
unnecessary.  So the latter method has been deleted.  All uses
of that method have been removed.

Removed unnecessary deepcopy() in STIXJSONEncoder, to improve
efficiency.  This uncovered a bug which had been affecting
STIXdatetime instances.  Not deepcopying doesn't trip the bug,
which can change serialization format.  This caused a unit
test to fail, which was checking serialization format.  I fixed
the unit test.

Fixed a bug in _STIXBase.__repr__ which caused it to omit all
properties with falsey values.  This caused several unit tests
to break, since they were written against the old buggy repr
format.  Notably, 'revoked=False' was never included in reprs
before, but it is now.
2021-07-06 20:32:58 -04:00
Emmanuelle Vargas-Gonzalez 6d285c47ae update test suite for use of .serialize(pretty=True) 2021-03-31 12:39:14 -04:00
Chris Lenk 14540c0ea1 Clean up _register_* functions
Made them consistent with _register_observable_extension, by:
- moving validation logic there from _custom_*_builder functions
- using a new function for ensuring properties are dict-like
- using the library default spec version instead of None

Fix #371, fix #372, fix #373.
2020-04-02 14:15:45 -04:00
Desai, Kartikey H a788dbb64c Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
Desai, Kartikey H 9941014f3a Update v20 test suite to fix issue 245 2019-01-22 23:07:20 -05:00
Emmanuelle Vargas-Gonzalez eff5369670 Merge branch 'master' of github.com:oasis-open/cti-python-stix2 into stix2.1 2018-11-01 07:57:09 -04:00
Emmanuelle Vargas-Gonzalez 51a499cb33 Formatting changes made by the new pre-commit hook 'add trailing commas'
closes #189
2018-07-13 11:10:05 -04:00
Emmanuelle Vargas-Gonzalez 281dbfb0f4 Align tests with news additions from 'master' branch. 2018-07-11 09:43:37 -04:00
Emmanuelle Vargas-Gonzalez ce42c02cee Fix tests that use property objects to call in the right path 2018-07-10 15:56:22 -04:00
Emmanuelle Vargas-Gonzalez 5be1636b10 Update v20 tests to ensure right methods and classes are used 2018-07-05 15:23:25 -04:00
Emmanuelle Vargas-Gonzalez 3100fa1fb8 Move v20 tests to their own package 2018-07-03 07:02:57 -04:00