Browse Source

Replace assertEqual(None, *) with assertIsNone in tests

Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.

Change-Id: I33b61064ec957a79bec4c6deef7ce5e4c8e8d141
Closes-bug: #1280522
tags/0.2.0
Shuquan Huang 3 years ago
parent
commit
8f46701afb
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      tests/validators/test_callable_validators.py

+ 7
- 7
tests/validators/test_callable_validators.py View File

@@ -418,7 +418,7 @@ class TestValidators(tests.DefaultRequestMixin, unittest.TestCase):
418 418
         ext.set_ca(False)
419 419
         csr.add_extension(ext)
420 420
 
421
-        self.assertEqual(None, internal.ca_status(csr=csr))
421
+        self.assertIsNone(internal.ca_status(csr=csr))
422 422
 
423 423
     def test_ca_status_forbidden(self):
424 424
         csr = x509_csr.X509Csr()
@@ -437,7 +437,7 @@ class TestValidators(tests.DefaultRequestMixin, unittest.TestCase):
437 437
         ext.set_path_len_constraint(1)
438 438
         csr.add_extension(ext)
439 439
 
440
-        self.assertEqual(None, internal.ca_status(csr=csr))
440
+        self.assertIsNone(internal.ca_status(csr=csr))
441 441
 
442 442
     def test_ca_status_key_usage_bad1(self):
443 443
         csr = x509_csr.X509Csr()
@@ -555,7 +555,7 @@ class TestValidators(tests.DefaultRequestMixin, unittest.TestCase):
555 555
 
556 556
     def test_csr_signature(self):
557 557
         csr = x509_csr.X509Csr.from_buffer(self.csr_sample)
558
-        self.assertEqual(None, custom.csr_signature(csr=csr))
558
+        self.assertIsNone(custom.csr_signature(csr=csr))
559 559
 
560 560
     def test_csr_signature_bad_sig(self):
561 561
         csr = x509_csr.X509Csr.from_buffer(self.csr_sample)
@@ -575,8 +575,8 @@ class TestValidators(tests.DefaultRequestMixin, unittest.TestCase):
575 575
 
576 576
     def test_public_key_good_rsa(self):
577 577
         csr = x509_csr.X509Csr.from_buffer(self.csr_sample)
578
-        self.assertEqual(None, custom.public_key(csr=csr,
579
-                                                 allowed_keys={'RSA': 1024}))
578
+        self.assertIsNone(custom.public_key(csr=csr,
579
+                                            allowed_keys={'RSA': 1024}))
580 580
 
581 581
     def test_public_key_good_dsa(self):
582 582
         dsa_key_pem = """
@@ -596,8 +596,8 @@ class TestValidators(tests.DefaultRequestMixin, unittest.TestCase):
596 596
                               asn1Spec=rfc2459.SubjectPublicKeyInfo())[0]
597 597
         csr = x509_csr.X509Csr.from_buffer(self.csr_sample)
598 598
         csr._csr['certificationRequestInfo']['subjectPublicKeyInfo'] = spki
599
-        self.assertEqual(None, custom.public_key(csr=csr,
600
-                                                 allowed_keys={'DSA': 1024}))
599
+        self.assertIsNone(custom.public_key(csr=csr,
600
+                                            allowed_keys={'DSA': 1024}))
601 601
 
602 602
     def test_public_key_too_short(self):
603 603
         csr = x509_csr.X509Csr.from_buffer(self.csr_sample)

Loading…
Cancel
Save