Skip to content

Commit

Permalink
test: Fix expectations for Model __str__
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 4, 2024
1 parent 741f0a4 commit af0543b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ builtins-ignorelist = ["copyright"]
"PT", # unittest
"ARG002", # mocks
"BLE001", # Exception
"PLR0913", # Too many arguments to function call
"PLR0913", # Too many arguments
"PLR2004", # Magic value used
"S101", # assert
]
Expand Down
11 changes: 7 additions & 4 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ def test_str(self):
class CollectionFileItemTests(TestCase):
def test_str(self):
obj = CollectionFileItem()
self.assertEqual(str(obj), "step no. {number} (id: {id})")
self.assertEqual(str(obj), "{collection_file_id}:{number} (id: {id})")

obj.number = 10
self.assertEqual(str(obj), "step no. 10 (id: {id})")
self.assertEqual(str(obj), "{collection_file_id}:10 (id: {id})")

obj.collection_file_id = 1
self.assertEqual(str(obj), "1:10 (id: {id})")


class DataTests(TestCase):
Expand All @@ -170,10 +173,10 @@ def test_str(self):
class PackageDataTests(TestCase):
def test_str(self):
obj = PackageData()
self.assertEqual(str(obj), "")
self.assertEqual(str(obj), "{hash_md5} (id: {id})")

obj.hash_md5 = "1bc29b36f623ba82aaf6724fd3b16718"
self.assertEqual(str(obj), "1bc29b36f623ba82aaf6724fd3b16718")
self.assertEqual(str(obj), "1bc29b36f623ba82aaf6724fd3b16718 (id: {id})")


class ReleaseTests(TestCase):
Expand Down

0 comments on commit af0543b

Please sign in to comment.