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

Minor fix to certain relational data sink unit tests related to dictionary properties #603

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stix2/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def clean(self, value, allow_custom=False, strict=False):
except CustomContentError:
# Need to propagate these, not treat as a type error
raise
except Exception as e:
except Exception:
# clean failed; value must not conform to type_
# Should be a narrower exception type here, but I don't
# know if it's safe to assume any particular exception
Expand Down
4 changes: 1 addition & 3 deletions stix2/test/v21/test_datastore_relational_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,7 @@ class Embedded(stix2.v21._STIXBase21):

elif request.param == "dict-of":
prop_variation = stix2.properties.DictionaryProperty(
# DictionaryProperty.valid_types does not accept property
# instances (except ListProperty instances), only classes...
valid_types=type(base_property)
valid_types=base_property
)
# key name doesn't matter here
prop_variation_value = {"key": prop_value}
Expand Down
Loading