Skip to content

Commit

Permalink
Adjust unit tests to take account of BaseConfig new abstract method
Browse files Browse the repository at this point in the history
  • Loading branch information
isbm committed Mar 18, 2024
1 parent d8ea7e5 commit 454cdbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions embdgen-core/tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class TestConfig(BaseConfig):
def load(self, filename: Path):
return MBR()

def load_str(self, data: str):
return MBR()

@classmethod
def probe(cls, _filename: Path) -> bool:
return True
Expand All @@ -25,6 +28,10 @@ def load(self, filename: Path):
self.__class__.was_called = True
return MBR()

def load_str(self, data: str):
self.__class__.was_called = True
return MBR()

@classmethod
def probe(cls, _filename: Path) -> bool:
return False
Expand Down
3 changes: 3 additions & 0 deletions embdgen-core/tests/config/test_BaseConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class ConfigFoo(BaseConfig):
def load(self, filename: Path) -> BaseLabel:
return None

def load_str(self, data: str) -> BaseLabel:
return None

def test_BaseConfig():
c = ConfigFoo()
assert c.probe(Path("")) is False

0 comments on commit 454cdbd

Please sign in to comment.