Fixed a test fixture to call the cti-taxii-client Collection

constructor correctly.  It had been recently changed to address
issue #39 in that library.
stix2.0
Michael Chisholm 2018-09-07 17:47:24 -04:00
parent b5a301ff28
commit 541c682bf6
1 changed files with 6 additions and 4 deletions

View File

@ -16,8 +16,10 @@ COLLECTION_URL = 'https://example.com/api1/collections/91a7b528-80eb-42ed-a74d-c
class MockTAXIICollectionEndpoint(Collection): class MockTAXIICollectionEndpoint(Collection):
"""Mock for taxii2_client.TAXIIClient""" """Mock for taxii2_client.TAXIIClient"""
def __init__(self, url, **kwargs): def __init__(self, url, collection_info):
super(MockTAXIICollectionEndpoint, self).__init__(url, **kwargs) super(MockTAXIICollectionEndpoint, self).__init__(
url, collection_info=collection_info
)
self.objects = [] self.objects = []
def add_objects(self, bundle): def add_objects(self, bundle):
@ -68,7 +70,7 @@ class MockTAXIICollectionEndpoint(Collection):
@pytest.fixture @pytest.fixture
def collection(stix_objs1): def collection(stix_objs1):
mock = MockTAXIICollectionEndpoint(COLLECTION_URL, **{ mock = MockTAXIICollectionEndpoint(COLLECTION_URL, {
"id": "91a7b528-80eb-42ed-a74d-c6fbd5a26116", "id": "91a7b528-80eb-42ed-a74d-c6fbd5a26116",
"title": "Writable Collection", "title": "Writable Collection",
"description": "This collection is a dropbox for submitting indicators", "description": "This collection is a dropbox for submitting indicators",
@ -85,7 +87,7 @@ def collection(stix_objs1):
@pytest.fixture @pytest.fixture
def collection_no_rw_access(stix_objs1): def collection_no_rw_access(stix_objs1):
mock = MockTAXIICollectionEndpoint(COLLECTION_URL, **{ mock = MockTAXIICollectionEndpoint(COLLECTION_URL, {
"id": "91a7b528-80eb-42ed-a74d-c6fbd5a26116", "id": "91a7b528-80eb-42ed-a74d-c6fbd5a26116",
"title": "Not writeable or readable Collection", "title": "Not writeable or readable Collection",
"description": "This collection is a dropbox for submitting indicators", "description": "This collection is a dropbox for submitting indicators",