-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from collections.abc import Sequence | ||
|
||
from stpipe.container import AbstractModelContainer | ||
|
||
|
||
class BadContainer(Sequence): | ||
def __getitem__(self): | ||
pass | ||
|
||
def __len__(self): | ||
pass | ||
|
||
def save(self, path, save_model_func): | ||
pass | ||
|
||
@staticmethod | ||
def read_asn(filepath): | ||
pass | ||
|
||
def from_asn(self, asn_data, asn_file_path=None): | ||
pass | ||
|
||
|
||
class GoodContainer(BadContainer): | ||
@property | ||
def crds_observatory(self): | ||
return "" | ||
|
||
|
||
def test_good_container(): | ||
assert issubclass(GoodContainer, AbstractModelContainer) | ||
gc = GoodContainer() | ||
assert isinstance(gc, AbstractModelContainer) | ||
|
||
|
||
def test_bad_container(): | ||
assert not issubclass(BadContainer, AbstractModelContainer) | ||
bc = BadContainer() | ||
assert not isinstance(bc, AbstractModelContainer) |