Skip to content

Commit

Permalink
fix test failure in PY13
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenIceage committed Nov 27, 2024
1 parent 8cb9d32 commit 791ffb5
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions osctiny/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,20 @@ def test_write(self):

self.assertEqual(len(cl.entries), 3)
cl.write(path="/who/cares/test.changes")

self.assertEqual(len(omock.mock_calls), 6)
content = "".join(str(omock.mock_calls[x][1][0])
for x in range(2, 5))

self.assertEqual(
content,
"-------------------------------------------------------------------\n"
"Tue Jan 01 00:00:00 UTC 2019 - Andreas Hasenkopf <[email protected]>\n\n"
"Føø Bar\n\n"
"-------------------------------------------------------------------\n"
"Mon Jan 01 00:00:00 UTC 2018 - Andreas Pritschet <[email protected]>\n\n"
"Hellø Wørld\n\n"
"-------------------------------------------------------------------\n"
"Sun Jan 01 00:00:00 UTC 2017 - Andreas Hasenkopf <[email protected]>\n\n"
"First enŧry\n\n"
)
calls = [
mock.call().write(
'-------------------------------------------------------------------\n'
'Tue Jan 01 00:00:00 UTC 2019 - Andreas Hasenkopf <[email protected]>'
'\n\nFøø Bar\n\n'),
mock.call().write(
'-------------------------------------------------------------------\n'
'Mon Jan 01 00:00:00 UTC 2018 - Andreas Pritschet <[email protected]>'
'\n\nHellø Wørld\n\n'),
mock.call().write(
'-------------------------------------------------------------------\n'
'Sun Jan 01 00:00:00 UTC 2017 - Andreas Hasenkopf <[email protected]>'
'\n\nFirst enŧry\n\n')]
omock.assert_has_calls(calls, any_order=True)

def test_write_stringio(self):
buffer = StringIO("")
Expand Down

0 comments on commit 791ffb5

Please sign in to comment.