コード例 #1
0
 def test_configure_error_udp(self):
     """
 UDP is not a valid protocol for ``HttpAdapter``.
 """
     with self.assertRaises(InvalidUri):
         HttpAdapter.configure('udp://localhost:14265')
コード例 #2
0
 def test_configure_error_non_numeric_port(self):
     """
 Attempting to configure HttpAdapter with non-numeric port.
 """
     with self.assertRaises(InvalidUri):
         HttpAdapter.configure('http://localhost:iota/')
コード例 #3
0
 def test_configure_error_invalid_protocol(self):
     """
 Attempting to configure HttpAdapter with unsupported protocol.
 """
     with self.assertRaises(InvalidUri):
         HttpAdapter.configure('ftp://localhost:14265/')
コード例 #4
0
 def test_configure_error_empty_host(self):
     """
 Attempting to configure HttpAdapter with empty host.
 """
     with self.assertRaises(InvalidUri):
         HttpAdapter.configure('http://:14265')
コード例 #5
0
 def test_configure_error_missing_protocol(self):
     """
 Forgetting to add the protocol to the URI.
 """
     with self.assertRaises(InvalidUri):
         HttpAdapter.configure('localhost:14265')