Increase code coverage slightly

An Environment will always have a CompositeDataSource, so there was no way
those exceptions could get raised.
stix2.0
Chris Lenk 2018-04-02 16:44:57 -04:00
parent 3abfe7868a
commit dd8f0f5c72
2 changed files with 4 additions and 8 deletions

View File

@ -114,16 +114,10 @@ class Environment(DataStoreMixin):
create.__doc__ = ObjectFactory.create.__doc__
def add_filters(self, *args, **kwargs):
try:
return self.source.filters.update(*args, **kwargs)
except AttributeError:
raise AttributeError('Environment has no data source')
return self.source.filters.update(*args, **kwargs)
def add_filter(self, *args, **kwargs):
try:
return self.source.filters.add(*args, **kwargs)
except AttributeError:
raise AttributeError('Environment has no data source')
return self.source.filters.add(*args, **kwargs)
def parse(self, *args, **kwargs):
return _parse(*args, **kwargs)

View File

@ -16,6 +16,8 @@ def test_property():
p = Property()
assert p.required is False
assert p.clean('foo') == 'foo'
assert p.clean(3) == 3
def test_basic_clean():