preferred way to say that something needs to be implemented
This commit is contained in:
parent
f435a1bea4
commit
94b6be4e83
|
@ -162,11 +162,11 @@ class Config(dict):
|
|||
@abc.abstractmethod
|
||||
def is_complete(self):
|
||||
"""Check for completeness."""
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def is_valid(self):
|
||||
"""Check for valid file layout."""
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
|
|
@ -49,10 +49,12 @@ class TestConfig:
|
|||
assert Config({'A':np.ones(3,'i')}).__repr__() == Config({'A':[1,1,1]}).__repr__()
|
||||
|
||||
def test_abstract_is_valid(self):
|
||||
assert Config().is_valid is None
|
||||
with pytest.raises(NotImplementedError):
|
||||
Config().is_valid
|
||||
|
||||
def test_abstract_is_complete(self):
|
||||
assert Config().is_complete is None
|
||||
with pytest.raises(NotImplementedError):
|
||||
Config().is_complete
|
||||
|
||||
@pytest.mark.parametrize('data',[Rotation.from_random(),Orientation.from_random(lattice='cI')])
|
||||
def test_rotation_orientation(self,data):
|
||||
|
|
Loading…
Reference in New Issue