forked from pool/python-osc-tiny
- Add patch py313.patch to fix test failure OBS-URL: https://build.opensuse.org/request/show/1230054 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-osc-tiny?expand=0&rev=116
52 lines
2.4 KiB
Diff
52 lines
2.4 KiB
Diff
From 791ffb58cf8b1c09ee4d4a24b47f25e4d826f1e7 Mon Sep 17 00:00:00 2001
|
|
From: frozenIceage <ChHuang@suse.com>
|
|
Date: Wed, 27 Nov 2024 11:58:48 +0100
|
|
Subject: [PATCH] fix test failure in PY13
|
|
|
|
---
|
|
osctiny/tests/test_utils.py | 31 ++++++++++++++-----------------
|
|
1 file changed, 14 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/osctiny/tests/test_utils.py b/osctiny/tests/test_utils.py
|
|
index 10769f3..2a90ad0 100644
|
|
--- a/osctiny/tests/test_utils.py
|
|
+++ b/osctiny/tests/test_utils.py
|
|
@@ -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 <ahasenkopf@suse.com>\n\n"
|
|
- "Føø Bar\n\n"
|
|
- "-------------------------------------------------------------------\n"
|
|
- "Mon Jan 01 00:00:00 UTC 2018 - Andreas Pritschet <apritschet@suse.com>\n\n"
|
|
- "Hellø Wørld\n\n"
|
|
- "-------------------------------------------------------------------\n"
|
|
- "Sun Jan 01 00:00:00 UTC 2017 - Andreas Hasenkopf <ahasenkopf@suse.com>\n\n"
|
|
- "First enŧry\n\n"
|
|
- )
|
|
+ calls = [
|
|
+ mock.call().write(
|
|
+ '-------------------------------------------------------------------\n'
|
|
+ 'Tue Jan 01 00:00:00 UTC 2019 - Andreas Hasenkopf <ahasenkopf@suse.com>'
|
|
+ '\n\nFøø Bar\n\n'),
|
|
+ mock.call().write(
|
|
+ '-------------------------------------------------------------------\n'
|
|
+ 'Mon Jan 01 00:00:00 UTC 2018 - Andreas Pritschet <apritschet@suse.com>'
|
|
+ '\n\nHellø Wørld\n\n'),
|
|
+ mock.call().write(
|
|
+ '-------------------------------------------------------------------\n'
|
|
+ 'Sun Jan 01 00:00:00 UTC 2017 - Andreas Hasenkopf <ahasenkopf@suse.com>'
|
|
+ '\n\nFirst enŧry\n\n')]
|
|
+ omock.assert_has_calls(calls, any_order=True)
|
|
|
|
def test_write_stringio(self):
|
|
buffer = StringIO("")
|