Fix some TAXII DataStore tests

master
Chris Lenk 2020-04-03 15:58:56 -04:00
parent 9145bdf5e8
commit c7fb79d195
3 changed files with 15 additions and 8 deletions

View File

@ -4,7 +4,8 @@ from medallion.filters.basic_filter import BasicFilter
import pytest
from requests.models import Response
import six
from taxii2client import Collection, _filter_kwargs_to_query_params
from taxii2client import Collection
from taxii2client.common import _filter_kwargs_to_query_params
import stix2
from stix2.datastore import DataSourceError
@ -38,7 +39,8 @@ class MockTAXIICollectionEndpoint(Collection):
self.objects,
("id", "type", "version"),
[],
)
None,
)[0]
if objs:
return stix2.v20.Bundle(objects=objs)
else:
@ -59,7 +61,8 @@ class MockTAXIICollectionEndpoint(Collection):
objects,
("version",),
[],
)
None,
)[0]
else:
filtered_objects = []
if filtered_objects:

View File

@ -4,7 +4,8 @@ from medallion.filters.basic_filter import BasicFilter
import pytest
from requests.models import Response
import six
from taxii2client import Collection, _filter_kwargs_to_query_params
from taxii2client import Collection
from taxii2client.common import _filter_kwargs_to_query_params
import stix2
from stix2.datastore import DataSourceError
@ -38,8 +39,10 @@ class MockTAXIICollectionEndpoint(Collection):
self.objects,
("id", "type", "version"),
[],
)
None,
)[0]
if objs:
print(objs)
return stix2.v21.Bundle(objects=objs)
else:
resp = Response()
@ -59,7 +62,8 @@ class MockTAXIICollectionEndpoint(Collection):
objects,
("version",),
[],
)
None,
)[0]
else:
filtered_objects = []
if filtered_objects:

View File

@ -8,11 +8,11 @@ deps =
pytest
pytest-cov
coverage
taxii2-client<1.0.0
taxii2-client
fuzzywuzzy
haversine
python-Levenshtein
medallion<2.0.0
medallion
commands =
python -m pytest --cov=stix2 stix2/test/ --cov-report term-missing -W ignore::stix2.exceptions.STIXDeprecationWarning