Closed chisholm closed 1 year ago
Merging #542 (b5260c9) into master (17445a0) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #542 +/- ##
=======================================
Coverage 87.29% 87.29%
=======================================
Files 153 153
Lines 18033 18035 +2
=======================================
+ Hits 15742 15744 +2
Misses 2291 2291
Impacted Files | Coverage Δ | |
---|---|---|
stix2/test/test_spec_version_detect.py | 100.00% <ø> (ø) |
|
stix2/test/v20/test_utils.py | 100.00% <ø> (ø) |
|
stix2/test/v21/test_utils.py | 100.00% <ø> (ø) |
|
stix2/utils.py | 79.32% <100.00%> (+0.20%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 17445a0...b5260c9. Read the comment docs.
Fixes #541 .
Fix detect_spec_version() such that it uses presence of the "spec_version" property in a bundle to infer spec version, not the property's value. Update unit tests accordingly.
Content was discovered which consisted of a bundle with spec_version="2.1". This is (perhaps confusingly) a STIX 2.0 bundle, but it was incorrectly being identified by the library as a STIX 2.1 bundle. This produced the following error when parsing it:
because STIX 2.1 bundles don't have a spec_version property. The object's spec_version property was used to determine that it should not have a spec_version property. Doesn't make much sense. With this PR, you get:
This is correct: the library defines the spec_version property of STIX 2.0 bundles to have a fixed value of "2.0", since content of other spec versions is not supported in a STIX 2.0 bundle by this library. This shows the spec version of the bundle was properly detected.