Skip to content

Commit af0543b

Browse files
committed
test: Fix expectations for Model __str__
1 parent 741f0a4 commit af0543b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ builtins-ignorelist = ["copyright"]
4141
"PT", # unittest
4242
"ARG002", # mocks
4343
"BLE001", # Exception
44-
"PLR0913", # Too many arguments to function call
44+
"PLR0913", # Too many arguments
4545
"PLR2004", # Magic value used
4646
"S101", # assert
4747
]

tests/test_models.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,13 @@ def test_str(self):
152152
class CollectionFileItemTests(TestCase):
153153
def test_str(self):
154154
obj = CollectionFileItem()
155-
self.assertEqual(str(obj), "step no. {number} (id: {id})")
155+
self.assertEqual(str(obj), "{collection_file_id}:{number} (id: {id})")
156156

157157
obj.number = 10
158-
self.assertEqual(str(obj), "step no. 10 (id: {id})")
158+
self.assertEqual(str(obj), "{collection_file_id}:10 (id: {id})")
159+
160+
obj.collection_file_id = 1
161+
self.assertEqual(str(obj), "1:10 (id: {id})")
159162

160163

161164
class DataTests(TestCase):
@@ -170,10 +173,10 @@ def test_str(self):
170173
class PackageDataTests(TestCase):
171174
def test_str(self):
172175
obj = PackageData()
173-
self.assertEqual(str(obj), "")
176+
self.assertEqual(str(obj), "{hash_md5} (id: {id})")
174177

175178
obj.hash_md5 = "1bc29b36f623ba82aaf6724fd3b16718"
176-
self.assertEqual(str(obj), "1bc29b36f623ba82aaf6724fd3b16718")
179+
self.assertEqual(str(obj), "1bc29b36f623ba82aaf6724fd3b16718 (id: {id})")
177180

178181

179182
class ReleaseTests(TestCase):

0 commit comments

Comments
 (0)