Example #1
0
 def test_with_dns_name_no_tls(self):
     # The port specified in the config is returned if security is disabled,
     # even when a DNS name has been provided.
     ports = jujushell.get_ports({
         'dns-name': 'example.com', 'port': 4247, 'tls': False})
     self.assertEqual((4247,), ports)
Example #2
0
 def test_without_dns_name_no_tls(self):
     # The port specified in the config is returned if security is disabled.
     ports = jujushell.get_ports({'port': 8080, 'tls': False})
     self.assertEqual((8080,), ports)
Example #3
0
 def test_with_invalid_dns_name(self):
     # The DNS name is ignored if not valid.
     ports = jujushell.get_ports({'dns-name': ' ', 'port': 47, 'tls': True})
     self.assertEqual((47,), ports)
Example #4
0
 def test_without_dns_name(self):
     # The port specified in the config is returned if no DNS name is set.
     ports = jujushell.get_ports({'port': 8000, 'tls': True})
     self.assertEqual((8000,), ports)
Example #5
0
 def test_with_dns_name(self):
     # Ports 443 and 80 are returned if a DNS name has been provided.
     ports = jujushell.get_ports({
         'dns-name': 'example.com', 'port': 4247, 'tls': True})
     self.assertEqual((443,), ports)