diff options
author | Andreas Jaeger <aj@suse.com> | 2020-04-02 15:40:21 +0200 |
---|---|---|
committer | Andreas Jaeger <aj@suse.com> | 2020-04-02 15:48:09 +0200 |
commit | 82da2378eaf1e2283ed623760d065cc972dd0871 (patch) | |
tree | fc218fd7bc0842837e665ebd403965d1419f20f7 /glanceclient/tests/unit/test_http.py | |
parent | 6b5a16302218400650458738899c1fcbd8f4abfd (diff) | |
download | python-glanceclient-82da2378eaf1e2283ed623760d065cc972dd0871.tar.gz |
Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Remove hacking and friends from lower-constraints, they are not needed
for installation.
Change-Id: I5ae47a7b11ff29a301e440c15daf30db7738485b
Diffstat (limited to 'glanceclient/tests/unit/test_http.py')
-rw-r--r-- | glanceclient/tests/unit/test_http.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/glanceclient/tests/unit/test_http.py b/glanceclient/tests/unit/test_http.py index 2f72b9a..b2035c9 100644 --- a/glanceclient/tests/unit/test_http.py +++ b/glanceclient/tests/unit/test_http.py @@ -367,11 +367,11 @@ class TestClient(testtools.TestCase): self.assertTrue(mock_log.called, 'LOG.debug never called') self.assertTrue(mock_log.call_args[0], 'LOG.debug called with no arguments') - hd_regex = ".*\s-H\s+'\s*%s\s*:\s*%s\s*'.*" % (hd_name, hd_val) + hd_regex = r".*\s-H\s+'\s*%s\s*:\s*%s\s*'.*" % (hd_name, hd_val) self.assertThat(mock_log.call_args[0][0], matchers.MatchesRegex(hd_regex), 'header not found in curl command') - body_regex = ".*\s-d\s+'%s'\s.*" % body + body_regex = r".*\s-d\s+'%s'\s.*" % body self.assertThat(mock_log.call_args[0][0], matchers.MatchesRegex(body_regex), 'body not found in curl command') @@ -390,12 +390,12 @@ class TestClient(testtools.TestCase): needles = {'key': key, 'cert': cert, 'cacert': cacert} for option, value in needles.items(): if value: - regex = ".*\s--%s\s+('%s'|%s).*" % (option, value, value) + regex = r".*\s--%s\s+('%s'|%s).*" % (option, value, value) self.assertThat(mock_log.call_args[0][0], matchers.MatchesRegex(regex), 'no --%s option in curl command' % option) else: - regex = ".*\s--%s\s+.*" % option + regex = r".*\s--%s\s+.*" % option self.assertThat(mock_log.call_args[0][0], matchers.Not(matchers.MatchesRegex(regex)), 'unexpected --%s option in curl command' % @@ -421,7 +421,7 @@ class TestClient(testtools.TestCase): self.assertTrue(mock_log.call_args[0], 'LOG.debug called with no arguments') self.assertThat(mock_log.call_args[0][0], - matchers.MatchesRegex('.*\s-k\s.*'), + matchers.MatchesRegex(r'.*\s-k\s.*'), 'no -k option in curl command') @mock.patch('glanceclient.common.http.LOG.debug') |