cti-python-stix2
cti-python-stix2 copied to clipboard
Fix for issue #572
Issue #572 errors when longitude or latitude has a 0 value. This fix takes into account 0 values for longitude and latitude.
Seems line two tests failed this time. Before you push again, run the tests in pycharm. Just click right on test-location.py and select test
Some other test, not in test-location.py, failed . Can you look into that?
It seems to be failing in the v20 tests
Any progress?
Tested the code locally and it passed. This fix should be correct.
Some minor style issues. If you fix them I can merge :-)
This is still incorrect. A boolean property can be False and present:
class FalseyTest(_STIXBase):
_type = "falsey"
_properties = {
"type": TypeProperty(_type, spec_version='2.1'),
"id": IDProperty(_type, spec_version='2.1'),
"foo": StringProperty(),
"falsey1": BooleanProperty(),
}
def _check_object_constraints(self):
super()._check_object_constraints()
super()._check_properties_dependency(["falsey1"], ["foo"])
# Should not throw since both props are present.
FalseyTest(foo="bar", falsey1=False)
still yields:
stix2.exceptions.DependentPropertiesError: The property dependencies for FalseyTest: (falsey1, foo) are not met.
The problem is that a falsey test was done in a context where it did not correctly substitute for a presence test. Sometimes you can get away with that, sometimes you can't. A direct presence test is better here, e.g. if p in self....
@HackerShark - still some linty errors - see tox run.
@chisholm - when Mo fixed these errors, and you review his change for me?