store:
- Use utils.get_type_from_id() instead of my own (I didn't know it
was already there)
- Use dict-style instead of attribute-style access to get stix
object properties
- Convert timezone-aware timestamps to UTC in _timestamp2filename()
to ensure that different times always result in different
filenames.
Also added a couple new tests for _timestamp2filename(), which
exercises the timezone conversion code.
Factored out the _is_marking() function from the memory datastore
module to utils so it can be reused, and changed both filesystem
and memory datastore modules to import and use it.
test data corpus. Updated filesystem store tests accordingly:
- Remove comments from all_versions tests stating that multiple
versions are not supported. Improve the tests to ensure that
all versions are in fact retrieved.
- Update the get() test to assure that it gets only the latest
version, when there is more than one version.
- Update some count checks, since there are more objects now
- Fix some typos
store:
- Use utils.get_type_from_id() instead of my own (I didn't know it
was already there)
- Use dict-style instead of attribute-style access to get stix
object properties
- Convert timezone-aware timestamps to UTC in _timestamp2filename()
to ensure that different times always result in different
filenames.
Also added a couple new tests for _timestamp2filename(), which
exercises the timezone conversion code.
Factored out the _is_marking() function from the memory datastore
module to utils so it can be reused, and changed both filesystem
and memory datastore modules to import and use it.
Whether or not the Observable type is in the EXT_MAP already, using a
custom extension without also using allow_custom=True should result in
the same behavior/error message.
A marking definition's `created` property doesn't require millisecond
preprecision, but for TLP markings the TLP instances provided in the
spec must be used and they all use millisecond precision.
Updated properties to support more constrains.
Make all regexes literal strings.
Update tests to align to new constrains.
Workbench problem. _check_object_constraints() uses instance class to
perform proper class resolution calls.
says are the required types for its parameters. It gave
specific types (list and set), when really it worked with more
than just that (iterables). And I certainly didn't only call
it with just lists and sets.