Blob Blame History Raw
From e40fdf22124f9dbcc5f91578c9fd9f9b14625726 Mon Sep 17 00:00:00 2001
From: Dominik Rumian <drumian@redhat.com>
Date: Tue, 24 Aug 2021 13:54:38 +0200
Subject: [PATCH] [PATCH] Use 'six' library in tests

Signed-off-by: Dominik Rumian <drumian@redhat.com>
---
 tests/test_cli.py       | 4 ++--
 tests/test_lookaside.py | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/test_cli.py b/tests/test_cli.py
index 735f4d7..cf4e5b3 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1534,8 +1534,8 @@ class TestImportSrpm(LookasideCacheMock, CliTestCase):
         # Exception is not a functionality issue. There is no problem with
         # uploading same file twice in a test however, the upload method checks
         # if file has been already uploaded.
-        self.assertRaisesRegex(AlreadyUploadedError, r'File already uploaded',
-                               self.assert_import_srpm, self.cloned_repo_path)
+        six.assertRaisesRegex(self, AlreadyUploadedError, r'File already uploaded',
+                              self.assert_import_srpm, self.cloned_repo_path)
 
     def test_import_gating_and_rpmlintrc_exception(self):
         # Add three additional files to the repo. Former gating.yaml and package.rpmlintrc are
diff --git a/tests/test_lookaside.py b/tests/test_lookaside.py
index 6946b79..5ad3e7b 100644
--- a/tests/test_lookaside.py
+++ b/tests/test_lookaside.py
@@ -15,6 +15,8 @@ import unittest
 
 import mock
 import pycurl
+import six
+
 from pyrpkg.errors import (AlreadyUploadedError, DownloadError,
                            InvalidHashType, UploadError)
 from pyrpkg.lookaside import CGILookasideCache
@@ -512,8 +514,8 @@ class CGILookasideCacheTestCase(unittest.TestCase):
         with mock.patch.object(lc, 'remote_file_exists', lambda *x: True):
             # self.assertRaises(AlreadyUploadedError, lc.upload, 'pyrpkg',
             #                  'pyrpkg-0.tar.xz', hash)
-            self.assertRaisesRegex(AlreadyUploadedError, r'File already uploaded',
-                                   lc.upload, 'pyrpkg', 'pyrpkg-0.tar.xz', hash)
+            six.assertRaisesRegex(self, AlreadyUploadedError, r'File already uploaded',
+                                  lc.upload, 'pyrpkg', 'pyrpkg-0.tar.xz', hash)
 
         self.assertEqual(curl.perform.call_count, 0)
         self.assertEqual(curl.setopt.call_count, 0)
-- 
2.31.1