Merge fork changes.

stix2.1
Emmanuelle Vargas-Gonzalez 2017-05-26 15:30:30 -04:00
commit 835d675162
2 changed files with 23 additions and 3 deletions

View File

@ -412,9 +412,7 @@ class DataSource(object):
stix_obj (dictionary): the STIX object to be returned stix_obj (dictionary): the STIX object to be returned
""" """
stix_obj = None raise NotImplementedError()
return stix_obj
@abc.abstractmethod @abc.abstractmethod
def all_versions(self, id_, _composite_filters=None): def all_versions(self, id_, _composite_filters=None):

View File

@ -0,0 +1,22 @@
import pytest
import stix2.sources
def test_data_source():
ds = stix2.sources.DataSource()
assert ds.name == "DataSource"
def test_set_data_source_name():
ds = stix2.sources.DataSource(name="My Data Source")
assert ds.name == "My Data Source"
def test_data_source_get():
ds = stix2.sources.DataSource(name="My Data Source")
with pytest.raises(NotImplementedError):
ds.get("foo")