def test_ensure_3306_4(self):
     protocolService = ProtocolService("with-http,with-ssh")
     protocolService.ensure_port_3306()
     self.assertTrue(3306 in protocolService.get_ports())
 def test_port_from_database(self):
     protocolServoce = ProtocolService("with-database")
     self.assertEqual(3306, protocolServoce.get_ports()[0])
 def test_ensure_3306_2(self):
     protocolService = ProtocolService("with-database")
     protocolService.ensure_port_3306()
     self.assertTrue(3306 in protocolService.get_ports())
 def test_ensure_443_4(self):
     protocolService = ProtocolService("with-https,with-ssh")
     protocolService.ensure_port_443()
     self.assertTrue(443 in protocolService.get_ports())
 def test_ensure_443_5(self):
     protocolService = ProtocolService("")
     protocolService.ensure_port_443()
     self.assertTrue(443 in protocolService.get_ports())
 def test_ensure_3389(self):
     protocolService = ProtocolService()
     protocolService.ensure_port_3389()
     self.assertTrue(3389 in protocolService.get_ports())
 def test_ensure_443_3(self):
     protocolService = ProtocolService("with-desktop")
     protocolService.ensure_port_443()
     self.assertTrue(443 in protocolService.get_ports())
Esempio n. 8
0
 def test_port_both_options(self):
     protocolService = ProtocolService("with-ssh,with-http")
     returned_ports = protocolService.get_ports()
     self.assertEqual(22, returned_ports[0])
     self.assertEqual(80, returned_ports[1])
Esempio n. 9
0
 def test_port_three_options(self):
     protocolService = ProtocolService("with-ssh,with-http,with-database")
     returned_ports = protocolService.get_ports()
     self.assertEqual(22, returned_ports[0])
     self.assertEqual(80, returned_ports[1])
     self.assertEqual(3306, returned_ports[2])
 def test_ensure_80_5(self):
     protocolService = ProtocolService("")
     protocolService.ensure_port_80()
     self.assertTrue(80 in protocolService.get_ports())
Esempio n. 11
0
 def test_get_zero_element_none(self):
     protocolServoce = ProtocolService()
     self.assertEqual(0, len(protocolServoce.get_ports()))
 def test_ensure_80_4(self):
     protocolService = ProtocolService("with-http,with-ssh")
     protocolService.ensure_port_80()
     self.assertTrue(80 in protocolService.get_ports())
 def test_port_from_http(self):
     protocolServoce = ProtocolService("with-http")
     self.assertEqual(80, protocolServoce.get_ports()[0])
 def test_ensure_3389_3(self):
     protocolService = ProtocolService("with-desktop")
     protocolService.ensure_port_3389()
     self.assertTrue(3389 in protocolService.get_ports())
 def test_ensure_3306_5(self):
     protocolService = ProtocolService("")
     protocolService.ensure_port_3306()
     self.assertTrue(3306 in protocolService.get_ports())
 def test_port_from_desktop(self):
     protocolService = ProtocolService("with-https")
     self.assertEqual(443, protocolService.get_ports()[0])
 def test_get_one_element(self):
     protocolServoce = ProtocolService("with-database")
     self.assertEqual(1, len(protocolServoce.get_ports()))
 def test_port_from_desktop(self):
     protocolService = ProtocolService("with-desktop")
     self.assertEqual(3389, protocolService.get_ports()[0])