summaryrefslogtreecommitdiff
path: root/tests/test_rrset.py
diff options
context:
space:
mode:
authorBrian Wellington <bwelling@xbill.org>2020-03-18 11:26:55 -0700
committerBrian Wellington <bwelling@xbill.org>2020-03-18 11:26:55 -0700
commite6798e58b4555740db4cfb43c8b9ce0d7d3416f1 (patch)
tree7a2a5286ca49e0fe814eef39082a6d59b3d7289a /tests/test_rrset.py
parentfc74c9261dcd36fd1ec0f10d48c9c0fc56ce17ea (diff)
downloaddnspython-e6798e58b4555740db4cfb43c8b9ce0d7d3416f1.tar.gz
Improve assertion checking.
This replaces lots of self.assertTrue() assertions with more specific assertions, such as replacing assertTrue(x == y) with assertEqual(x, y).
Diffstat (limited to 'tests/test_rrset.py')
-rw-r--r--tests/test_rrset.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_rrset.py b/tests/test_rrset.py
index e6a69f8..638dff3 100644
--- a/tests/test_rrset.py
+++ b/tests/test_rrset.py
@@ -24,33 +24,33 @@ class RRsetTestCase(unittest.TestCase):
def testEqual1(self):
r1 = dns.rrset.from_text('foo', 300, 'in', 'a', '10.0.0.1', '10.0.0.2')
r2 = dns.rrset.from_text('FOO', 300, 'in', 'a', '10.0.0.2', '10.0.0.1')
- self.assertTrue(r1 == r2)
+ self.assertEqual(r1, r2)
def testEqual2(self):
r1 = dns.rrset.from_text('foo', 300, 'in', 'a', '10.0.0.1', '10.0.0.2')
r2 = dns.rrset.from_text('FOO', 600, 'in', 'a', '10.0.0.2', '10.0.0.1')
- self.assertTrue(r1 == r2)
+ self.assertEqual(r1, r2)
def testNotEqual1(self):
r1 = dns.rrset.from_text('fooa', 30, 'in', 'a', '10.0.0.1', '10.0.0.2')
r2 = dns.rrset.from_text('FOO', 30, 'in', 'a', '10.0.0.2', '10.0.0.1')
- self.assertTrue(r1 != r2)
+ self.assertNotEqual(r1, r2)
def testNotEqual2(self):
r1 = dns.rrset.from_text('foo', 30, 'in', 'a', '10.0.0.1', '10.0.0.3')
r2 = dns.rrset.from_text('FOO', 30, 'in', 'a', '10.0.0.2', '10.0.0.1')
- self.assertTrue(r1 != r2)
+ self.assertNotEqual(r1, r2)
def testNotEqual3(self):
r1 = dns.rrset.from_text('foo', 30, 'in', 'a', '10.0.0.1', '10.0.0.2',
'10.0.0.3')
r2 = dns.rrset.from_text('FOO', 30, 'in', 'a', '10.0.0.2', '10.0.0.1')
- self.assertTrue(r1 != r2)
+ self.assertNotEqual(r1, r2)
def testNotEqual4(self):
r1 = dns.rrset.from_text('foo', 30, 'in', 'a', '10.0.0.1')
r2 = dns.rrset.from_text('FOO', 30, 'in', 'a', '10.0.0.2', '10.0.0.1')
- self.assertTrue(r1 != r2)
+ self.assertNotEqual(r1, r2)
if __name__ == '__main__':
unittest.main()