cti-python-stix2/stix2/test/v20
Michael Chisholm 5589480980 Improved the exception class hierarchy:
- Removed all plain python base classes (e.g. ValueError, TypeError)
- Renamed InvalidPropertyConfigurationError -> PropertyPresenceError,
  since incorrect values could be considered a property config error, and
  I really just wanted this class to apply to presence (co-)constraint
  violations.
- Added ObjectConfigurationError as a superclass of InvalidValueError,
  PropertyPresenceError, and any other exception that could be raised
  during _STIXBase object init, which is when the spec compliance
  checks happen.  This class is intended to represent general spec
  violations.
- Did some class reordering in exceptions.py, so all the
  ObjectConfigurationError subclasses were together.

Changed how property "cleaning" errors were handled:
- Previous docs said they should all be ValueErrors, but that would require
  extra exception check-and-replace complexity in the property
  implementations, so that requirement is removed.  Doc is changed to just
  say that cleaning problems should cause exceptions to be raised.
  _STIXBase._check_property() now handles most exception types, not just
  ValueError.
- Decided to try chaining the original clean error to the InvalidValueError,
  in case the extra diagnostics would be helpful in the future.  This is
  done via 'six' adapter function and only works on python3.
- A small amount of testing was removed, since it was looking at custom
  exception properties which became unavailable once the exception was
  replaced with InvalidValueError.

Did another pass through unit tests to fix breakage caused by the changed
exception class hierarchy.

Removed unnecessary observable extension handling code from
parse_observable(), since it was all duplicated in ExtensionsProperty.
The redundant code in parse_observable() had different exception behavior
than ExtensionsProperty, which makes the API inconsistent and unit tests
more complicated.  (Problems in ExtensionsProperty get replaced with
InvalidValueError, but extensions problems handled directly in
parse_observable() don't get the same replacement, and so the exception
type is different.)

Redid the workbench monkeypatching.  The old way was impossible to make
work, and had caused ugly ripple effect hackage in other parts of the
codebase.  Now, it replaces the global object maps with factory functions
which behave the same way when called, as real classes.  Had to fix up a
few unit tests to get them all passing with this monkeypatching in place.
Also remove all the xfail markings in the workbench test suite, since all
tests now pass.

Since workbench monkeypatching isn't currently affecting any unit tests,
tox.ini was simplified to remove the special-casing for running the
workbench tests.

Removed the v20 workbench test suite, since the workbench currently only
works with the latest stix object version.
2019-07-19 14:50:11 -04:00
..
stix2_data Update timestamps in v20 testsuite JSON files 2019-01-23 13:42:25 -05:00
__init__.py Create new test subpackages 2018-06-30 19:36:54 -04:00
conftest.py Formatting changes made by the new pre-commit hook 'add trailing commas' 2018-07-13 11:10:05 -04:00
constants.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_attack_pattern.py Start updating test suites to fix issue 245 2019-01-22 21:25:09 -05:00
test_base.py Move v20 tests to their own package 2018-07-03 07:02:57 -04:00
test_bundle.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_campaign.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_core.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_course_of_action.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_custom.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_datastore.py more pre-commit changes 2018-11-29 13:50:05 -05:00
test_datastore_composite.py Merge branch 'master' of github.com:oasis-open/cti-python-stix2 into stix2.1 2018-11-01 07:57:09 -04:00
test_datastore_filesystem.py Remove certain human message assertions from test suites 2019-07-09 13:34:19 -04:00
test_datastore_filters.py Update v21 test suite. Fixes #245 2019-01-23 10:56:20 -05:00
test_datastore_memory.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_datastore_taxii.py Update test_datastore_taxii.py 2018-11-29 18:45:34 -05:00
test_environment.py Merge branch 'master' of github.com:oasis-open/cti-python-stix2 into stix2.1 2018-11-01 07:57:09 -04:00
test_external_reference.py Formatting changes made by the new pre-commit hook 'add trailing commas' 2018-07-13 11:10:05 -04:00
test_fixtures.py Merge branch 'master' of github.com:oasis-open/cti-python-stix2 into stix2.1 2018-07-11 09:41:42 -04:00
test_granular_markings.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_identity.py Start updating test suites to fix issue 245 2019-01-22 21:25:09 -05:00
test_indicator.py Merge branch 'master' into stix2.1 2019-06-26 12:22:40 -04:00
test_intrusion_set.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_kill_chain_phases.py Update v20 tests to ensure right methods and classes are used 2018-07-05 15:23:25 -04:00
test_malware.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_marking_definition.py update tests to make sure we are testing the serialized instance correctly 2019-05-08 10:36:31 -04:00
test_markings.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_object_markings.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_observed_data.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_pattern_expressions.py Remove certain human message assertions from test suites 2019-07-09 13:34:19 -04:00
test_pickle.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_properties.py Improved the exception class hierarchy: 2019-07-19 14:50:11 -04:00
test_relationship.py Update v20 test suite to fix issue 245 2019-01-22 23:07:20 -05:00
test_report.py Merge branch 'master' into stix2.1 2019-06-26 12:22:40 -04:00
test_sighting.py Merge branch 'master' into stix2.1 2019-06-26 12:22:40 -04:00
test_threat_actor.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_tool.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_utils.py Replace most SDO/SRO values in tests with IDs from constants.py 2019-01-29 10:52:59 -05:00
test_versioning.py Formatting changes made by the new pre-commit hook 'add trailing commas' 2018-07-13 11:10:05 -04:00
test_vulnerability.py Update v20 test suite to fix issue 245 2019-01-22 23:07:20 -05:00