Test other CompositeDataSource operations

stix2.0
Emmanuelle Vargas-Gonzalez 2017-11-03 15:13:00 -04:00
parent 6f1ab52aa5
commit 0d5859b906
1 changed files with 10 additions and 0 deletions

View File

@ -543,3 +543,13 @@ def test_composite_datasource_operations():
assert indicator["id"] == "indicator--d81f86b9-975b-bc0b-775e-810c5ad45a4f"
assert indicator["modified"] == "2017-01-31T13:49:53.935Z"
assert indicator["type"] == "indicator"
# There is only one indicator with different ID. Since we use the same data
# when deduplicated, only two indicators (one with different modified).
results = cds1.all_versions("indicator--d81f86b9-975b-bc0b-775e-810c5ad45a4f")
assert len(results) == 2
# Since we have filters already associated with our CompositeSource providing
# nothing returns the same as cds1.query(query1) (the associated query is query2)
results = cds1.query([])
assert len(results) == 3