[tor-commits] [stem/master] Drop tests for invalid signing argument

atagar at torproject.org atagar at torproject.org
Tue Feb 11 01:40:22 UTC 2020


commit 91ef638728b398fcfed01ea243afecaf488b1fb7
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Feb 10 17:39:59 2020 -0800

    Drop tests for invalid signing argument
    
    Oops, I forgot to install cryptography under python 3.7 so I didn't exercise
    several tests. This doesn't fix all the failures but corrects the most obvious
    (we removed the sign argument when it was irrelevant).
---
 test/unit/descriptor/extrainfo_descriptor.py              | 5 -----
 test/unit/descriptor/hidden_service_v2.py                 | 4 ----
 test/unit/descriptor/microdescriptor.py                   | 4 ----
 test/unit/descriptor/networkstatus/directory_authority.py | 4 ----
 test/unit/descriptor/networkstatus/document_v2.py         | 4 ----
 test/unit/descriptor/networkstatus/document_v3.py         | 4 ----
 test/unit/descriptor/networkstatus/key_certificate.py     | 4 ----
 test/unit/descriptor/router_status_entry.py               | 6 ------
 test/unit/descriptor/server_descriptor.py                 | 1 -
 9 files changed, 36 deletions(-)

diff --git a/test/unit/descriptor/extrainfo_descriptor.py b/test/unit/descriptor/extrainfo_descriptor.py
index 6eea7fde..25cbf489 100644
--- a/test/unit/descriptor/extrainfo_descriptor.py
+++ b/test/unit/descriptor/extrainfo_descriptor.py
@@ -142,11 +142,6 @@ k0d2aofcVbHr4fPQOSST0LXDrhFl5Fqo5um296zpJGvRUeO6S44U/EfJAGShtqWw
 
     self.assertEqual('@type bridge-extra-info 1.0', str(desc.type_annotation()))
 
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    RelayExtraInfoDescriptor.create(sign = True)
-    self.assertRaisesWith(NotImplementedError, 'Signing of BridgeExtraInfoDescriptor not implemented', BridgeExtraInfoDescriptor.create, sign = True)
-
   def test_multiple_metrics_bridge_descriptors(self):
     """
     Check that we can read bridge descriptors when there's multiple in a file.
diff --git a/test/unit/descriptor/hidden_service_v2.py b/test/unit/descriptor/hidden_service_v2.py
index fd90f693..54553d03 100644
--- a/test/unit/descriptor/hidden_service_v2.py
+++ b/test/unit/descriptor/hidden_service_v2.py
@@ -278,10 +278,6 @@ class TestHiddenServiceDescriptorV2(unittest.TestCase):
     self.assertEqual([2, 3], desc.protocol_versions)
 
   @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of HiddenServiceDescriptorV2 not implemented', HiddenServiceDescriptorV2.create, sign = True)
-
-  @test.require.cryptography
   def test_with_basic_auth(self):
     """
     Parse a descriptor with introduction-points encrypted with basic auth.
diff --git a/test/unit/descriptor/microdescriptor.py b/test/unit/descriptor/microdescriptor.py
index 8d2c07e7..b0b8ebaf 100644
--- a/test/unit/descriptor/microdescriptor.py
+++ b/test/unit/descriptor/microdescriptor.py
@@ -98,10 +98,6 @@ class TestMicrodescriptor(unittest.TestCase):
     self.assertEqual({}, desc.protocols)
     self.assertEqual([], desc.get_unrecognized_lines())
 
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of Microdescriptor not implemented', Microdescriptor.create, sign = True)
-
   def test_unrecognized_line(self):
     """
     Includes unrecognized content in the descriptor.
diff --git a/test/unit/descriptor/networkstatus/directory_authority.py b/test/unit/descriptor/networkstatus/directory_authority.py
index 325fad12..6153aa64 100644
--- a/test/unit/descriptor/networkstatus/directory_authority.py
+++ b/test/unit/descriptor/networkstatus/directory_authority.py
@@ -52,10 +52,6 @@ class TestDirectoryAuthority(unittest.TestCase):
     self.assertEqual(None, authority.legacy_dir_key)
     self.assertEqual([], authority.get_unrecognized_lines())
 
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of DirectoryAuthority not implemented', DirectoryAuthority.create, sign = True)
-
   def test_unrecognized_line(self):
     """
     Includes unrecognized content in the descriptor.
diff --git a/test/unit/descriptor/networkstatus/document_v2.py b/test/unit/descriptor/networkstatus/document_v2.py
index 7dcc235b..7fb96328 100644
--- a/test/unit/descriptor/networkstatus/document_v2.py
+++ b/test/unit/descriptor/networkstatus/document_v2.py
@@ -104,7 +104,3 @@ TpQQk3nNQF8z6UIvdlvP+DnJV4izWVkQEZgUZgIVM0E=
     self.assertEqual([], document.server_versions)
     self.assertEqual([], document.options)
     self.assertEqual('moria2', document.signing_authority)
-
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of NetworkStatusDocumentV2 not implemented', NetworkStatusDocumentV2.create, sign = True)
diff --git a/test/unit/descriptor/networkstatus/document_v3.py b/test/unit/descriptor/networkstatus/document_v3.py
index 62ce6073..3e3b6953 100644
--- a/test/unit/descriptor/networkstatus/document_v3.py
+++ b/test/unit/descriptor/networkstatus/document_v3.py
@@ -358,10 +358,6 @@ DnN5aFtYKiTc19qIC7Nmo+afPdDEf0MlJvEOP5EWl3w=
     self.assertEqual({}, document.bandwidth_weights)
     self.assertEqual([], document.get_unrecognized_lines())
 
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of NetworkStatusDocumentV3 not implemented', NetworkStatusDocumentV3.create, sign = True)
-
   def test_examples(self):
     """
     Run something similar to the examples in the header pydocs.
diff --git a/test/unit/descriptor/networkstatus/key_certificate.py b/test/unit/descriptor/networkstatus/key_certificate.py
index 985610fb..ee5cd92c 100644
--- a/test/unit/descriptor/networkstatus/key_certificate.py
+++ b/test/unit/descriptor/networkstatus/key_certificate.py
@@ -140,10 +140,6 @@ GM9hAsAMRX9Ogqhq5UjDNqEsvDKuyVeyh7unSZEOip9Zr6K/+7VsVPNb8vfBRBjo
       self.assertEqual(expected_key_cert, cert.certification)
       self.assertEqual([], cert.get_unrecognized_lines())
 
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of KeyCertificate not implemented', KeyCertificate.create, sign = True)
-
   def test_unrecognized_line(self):
     """
     Includes unrecognized content in the descriptor.
diff --git a/test/unit/descriptor/router_status_entry.py b/test/unit/descriptor/router_status_entry.py
index 3aa02ecc..4b2837b8 100644
--- a/test/unit/descriptor/router_status_entry.py
+++ b/test/unit/descriptor/router_status_entry.py
@@ -175,12 +175,6 @@ class TestRouterStatusEntry(unittest.TestCase):
     self.assertEqual('aiUklwBrua82obG5AsTX+iEpkjQA2+AQHxZ7GwMfY70', entry.microdescriptor_digest)
     self.assertEqual([], entry.get_unrecognized_lines())
 
-  @test.require.cryptography
-  def test_descriptor_signing(self):
-    self.assertRaisesWith(NotImplementedError, 'Signing of RouterStatusEntryV2 not implemented', RouterStatusEntryV2.create, sign = True)
-    self.assertRaisesWith(NotImplementedError, 'Signing of RouterStatusEntryV3 not implemented', RouterStatusEntryV3.create, sign = True)
-    self.assertRaisesWith(NotImplementedError, 'Signing of RouterStatusEntryMicroV3 not implemented', RouterStatusEntryMicroV3.create, sign = True)
-
   def test_without_ed25519(self):
     """
     Parses a router status entry without a ed25519 value.
diff --git a/test/unit/descriptor/server_descriptor.py b/test/unit/descriptor/server_descriptor.py
index 6524f9d8..99eb2d27 100644
--- a/test/unit/descriptor/server_descriptor.py
+++ b/test/unit/descriptor/server_descriptor.py
@@ -261,7 +261,6 @@ Qlx9HNCqCY877ztFRC624ja2ql6A2hBcuoYMbkHjcQ4=
   @test.require.cryptography
   def test_descriptor_signing(self):
     RelayDescriptor.create(sign = True)
-    self.assertRaisesWith(NotImplementedError, 'Signing of BridgeDescriptor not implemented', BridgeDescriptor.create, sign = True)
 
   def test_router_status_entry(self):
     """



More information about the tor-commits mailing list