Blob Blame History Raw
commit 464d0e57656fbd5642df70857d46331738de05e6
Author: Aurélien Bompard <aurelien@bompard.org>
Date:   Thu Jul 25 17:34:25 2019 +0200

    Fix a couple tests on F31+
    
    Signed-off-by: Aurélien Bompard <aurelien@bompard.org>

diff --git a/bodhi/tests/client/test___init__.py b/bodhi/tests/client/test___init__.py
index a06780a3..a287b835 100644
--- a/bodhi/tests/client/test___init__.py
+++ b/bodhi/tests/client/test___init__.py
@@ -993,7 +993,13 @@ class TestQuery(unittest.TestCase):
             )
         ]
         self.assertEqual(send_request.mock_calls, calls)
-        mock_open.assert_called_with(fedora.client.openidbaseclient.b_SESSION_FILE, 'rb')
+        # Before F31 the file was opened in binary mode, and then it changed.
+        # Only check the path.
+        self.assertEqual(mock_open.call_count, 1)
+        self.assertEqual(
+            mock_open.call_args[0][0],
+            fedora.client.openidbaseclient.b_SESSION_FILE
+        )
 
     @mock.patch('bodhi.client.bindings.BodhiClient.csrf',
                 mock.MagicMock(return_value='a_csrf_token'))
@@ -1128,7 +1134,13 @@ class TestQueryBuildrootOverrides(unittest.TestCase):
             )
         ]
         self.assertEqual(send_request.mock_calls, calls)
-        mock_open.assert_called_with(fedora.client.openidbaseclient.b_SESSION_FILE, 'rb')
+        # Before F31 the file was opened in binary mode, and then it changed.
+        # Only check the path.
+        self.assertEqual(mock_open.call_count, 1)
+        self.assertEqual(
+            mock_open.call_args[0][0],
+            fedora.client.openidbaseclient.b_SESSION_FILE
+        )
 
     @mock.patch('bodhi.client.bindings.BodhiClient.csrf',
                 mock.MagicMock(return_value='a_csrf_token'))