Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
anneschuth committed Oct 13, 2024
1 parent bb2e7b8 commit 68c47d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions amt/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def system_card(self, value: SystemCard | None) -> None:
self.sync_system_card()

def sync_system_card(self) -> None:
if self._system_card is not None:
self.system_card_json = self._system_card.model_dump(exclude_unset=True)
self.system_card_json = self._system_card.model_dump(exclude_unset=True)


Project.__mapper_args__ = {"exclude_properties": ["_system_card"]}
12 changes: 12 additions & 0 deletions tests/models/test_model_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def test_model_systemcard_equal():

# then
assert project.system_card != system_card
assert project.system_card != {}


def test_model_systemcard_from_json():
Expand All @@ -77,3 +78,14 @@ def test_model_systemcard_from_json():

# then
assert project.system_card == SystemCard(name="Test System Card")


def test_model_systemcard_none():
# given
project = Project(name="Test Project")

# when
project.system_card = None

# then
assert project.system_card == SystemCard()

0 comments on commit 68c47d2

Please sign in to comment.