dict/mapping values: do a simple verification of the value's
STIX version, not just its type. Added a lot more unit tests to
test behavior on dicts. To make the implementation work, I had
to move the detect_spec_version() function out of the parsing
module and into utils. So that required small changes at all
its previous call sites.
class map structure is keyed by normal "X.Y" style versions,
the convenience that function provided is no longer necessary.
So it no longer makes sense to have the function (at least,
not for that reason). Change users of that function to use
the STIX2_OBJ_MAPS structure directly.
level with STIX versions in the same format as is used everywhere
else in the API: "X.Y", as opposed to the "vXY" format used by
the version-specific python packages. This eliminates all of
the awkward conversion from public API format to "vXX" format.
Also a little bit of code rearranging in the registration module
to ensure that some STIX 2.1-specific checks are done whether
version 2.1 is given explicitly or is defaulted to.
In the same module I also added a missing import of
stix2.properties, since my IDE was claiming it could not find a
function from that module.
top-level stix2 package to stix2.version but import it into
stix2. This makes it possible for someone to get the symbol
without needing to import all of stix2.
Change an "import X" style import to "from X import Y" in
stix2/__init__.py to be consistent with the other imports in
that file.
- stix2.registry, which contains the class mapping structure
and code for scanning stix2 modules for its initial population
- stix2.registration, which contains code used to register custom
STIX types with the registry
- stix2.parsing, which contains code for creating instances of
registered stix2 classes from raw dicts.
This is intended to reduce circular import problems, by giving
dependent code the ability to import a module which has exactly
the functionality it needs, without pulling a lot of other stuff
it doesn't need. Fewer imports means less chance of an import
cycle.
* Fix Location semantic equivalence check for Location objects without the latitude and longitude properties.
Uses contribution from @zrush-mitre (#464).
Fixes#462.
* Remove a line