summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJi-Wei <ji.wei3@zte.com.cn>2016-09-09 17:30:17 +0800
committerJi-Wei <ji.wei3@zte.com.cn>2016-09-09 17:30:46 +0800
commit5eb0f3debc320340965460c04a1d6ca4f9c423a3 (patch)
tree1a95b354b18ce85acc6944990f777e0baacf39a9 /tests
parent2737fae96eb20979451ba3932ddb54b0905d92b3 (diff)
downloadpython-swiftclient-5eb0f3debc320340965460c04a1d6ca4f9c423a3.tar.gz
Fix order of arguments in assertIs
Some tests used incorrect order assertIs(observed, expected). The correct order expected by testtools is assertIs(expected, observed, message='') Assert that expected is observed. Parameters: expected The expected value. observed The observed value. message An optional message describing the error. https://docs.python.org/2/library/unittest.html Change-Id: I5f406336b7804c13ca042dd0c6b30645a711c5f2
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_utils.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
index f0de79c..949c3e1 100644
--- a/tests/unit/test_utils.py
+++ b/tests/unit/test_utils.py
@@ -32,10 +32,10 @@ class TestConfigTrueValue(unittest.TestCase):
@mock.patch.object(u, 'TRUE_VALUES', 'hello world'.split())
def test_config_true_value(self):
for val in 'hello world HELLO WORLD'.split():
- self.assertIs(u.config_true_value(val), True)
- self.assertIs(u.config_true_value(True), True)
- self.assertIs(u.config_true_value('foo'), False)
- self.assertIs(u.config_true_value(False), False)
+ self.assertIs(True, u.config_true_value(val))
+ self.assertIs(True, u.config_true_value(True))
+ self.assertIs(False, u.config_true_value('foo'))
+ self.assertIs(False, u.config_true_value(False))
class TestPrtBytes(unittest.TestCase):
@@ -265,11 +265,11 @@ class TestReadableToIterable(unittest.TestCase):
# Check creation with a real and noop md5 class
data = u.ReadableToIterable(None, None, md5=True)
self.assertEqual(md5().hexdigest(), data.get_md5sum())
- self.assertIs(type(data.md5sum), type(md5()))
+ self.assertIs(type(md5()), type(data.md5sum))
data = u.ReadableToIterable(None, None, md5=False)
self.assertEqual('', data.get_md5sum())
- self.assertIs(type(data.md5sum), u.NoopMD5)
+ self.assertIs(u.NoopMD5, type(data.md5sum))
def test_unicode(self):
# Check no errors are raised if unicode data is feed in.