Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 296 #297

Closed
wants to merge 8 commits into from
Closed

Fix issue 296 #297

wants to merge 8 commits into from

Conversation

khdesai
Copy link
Contributor

@khdesai khdesai commented Oct 7, 2019

Change invalid_types="" to invalid_types=[""]

@khdesai
Copy link
Contributor Author

khdesai commented Nov 6, 2019

I assumed (correctly??) that for STIX 2.1, in _custom_observable_builder() props ending in *_ref(s) should be a ReferenceProperty.

I think we should remove test_custom_observable_object_invalid_valid_refs() since _valid_refs isn't really a thing anymore in STIX 2.1, due to ReferenceProperty (and the spec requirements that most (if not all) *_ref(s) properties need to have IDs as their values).

I changed all instances of parse_observable() to parse() in STIX 2.1-specific code only, except for test/v21/test_core.py's test_parse_observable_with_version() and test_parse_observable_with_no_version() since they specifically test the parse_observable function. This was done to highlight the fact that SCOs (STIX Cyber Observables) are now top-level objects in STIX 2.1.

I changed the CustomContentError (to a ParseError) in stix2/core.py's parse_observable(). For effectively the same error, parse() uses only ParseError, so I thought it fitting to make the errors consistent.

@khdesai
Copy link
Contributor Author

khdesai commented Nov 6, 2019

This pull request also addresses issues #298 and #299, so please let me know here if those issues have been resolved.

@clenk clenk closed this Nov 6, 2019
@clenk clenk reopened this Nov 6, 2019
@codecov-io
Copy link

codecov-io commented Nov 6, 2019

Codecov Report

Merging #297 into stix2.1 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           stix2.1     #297      +/-   ##
===========================================
+ Coverage    98.15%   98.15%   +<.01%     
===========================================
  Files          123      123              
  Lines        13845    13854       +9     
===========================================
+ Hits         13589    13598       +9     
  Misses         256      256
Impacted Files Coverage Δ
stix2/v21/sdo.py 95.29% <ø> (ø) ⬆️
stix2/v20/sro.py 100% <ø> (ø) ⬆️
stix2/v21/sro.py 94.73% <ø> (ø) ⬆️
stix2/v21/common.py 100% <ø> (ø) ⬆️
stix2/v20/sdo.py 100% <ø> (ø) ⬆️
stix2/v21/observables.py 96.96% <ø> (ø) ⬆️
stix2/custom.py 97.29% <100%> (+0.23%) ⬆️
stix2/test/v21/test_observed_data.py 100% <100%> (ø) ⬆️
stix2/properties.py 98.37% <100%> (+0.04%) ⬆️
stix2/test/v21/test_base.py 100% <100%> (ø) ⬆️
... and 3 more

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 d4c0115...e75d80d. Read the comment docs.

Copy link
Contributor

@clenk clenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; rebased and merged in with 1d9ff5d.

@clenk clenk closed this Dec 6, 2019
@khdesai khdesai deleted the spec_fixes branch December 10, 2019 15:18
@emmanvg emmanvg added this to the 1.3.0 milestone Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants