From 8fc421e7d43b9004841d109d8809da338c4a7c54 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 16 May 2018 15:17:34 -0400 Subject: [PATCH] think the mock client was erroneous for get_object(), couldnt get object by id, just returned random object --- stix2/test/test_datastore_taxii.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stix2/test/test_datastore_taxii.py b/stix2/test/test_datastore_taxii.py index 78a3284..dbade77 100644 --- a/stix2/test/test_datastore_taxii.py +++ b/stix2/test/test_datastore_taxii.py @@ -45,17 +45,17 @@ class MockTAXIICollectionEndpoint(Collection): resp.status_code = 404 resp.raise_for_status() - def get_object(self, id, version=None): + def get_object(self, id_, version=None): self._verify_can_read() - query_params = None + kwargs = {"id": id_} if version: - query_params = _filter_kwargs_to_query_params({"version": version}) - if query_params: - query_params = json.loads(query_params) + kwargs.update({"version": version}) + + query_params = _filter_kwargs_to_query_params(kwargs) full_filter = BasicFilter(query_params or {}) objs = full_filter.process_filter( self.objects, - ("version",), + ("version", "id"), [] ) if objs: