示例#1
0
 def test_fail_to_add_same_remote_port_in_same_host2(self):
     targets = {'food-nonfood': {
             'name': 'text-classification',
             'local_port': '8888', 'login_user': None, 'remote_port': '9999', 'server_port': None,
             'type': 'L', 'remote_host': 'localhost', 'ssh_server': 'my-ml-instance.ml.aws.com'
         }
     }
     add_command = AddCommand("image-processing", None, 'L', 'localhost', '9999', '7777',
                              'my-ml-instance.ml.aws.com', None, None,
                              None)
     self.assertEqual("9999", add_command.generate_consistent_target(targets)["remote_port"])
示例#2
0
 def test_add_target_without_remote_port(self):
     targets = {'food-nonfood': {
             'name': 'text-classification',
             'local_port': '8888', 'login_user': None,
             'remote_port': '6000', 'server_port': None,
             'type': 'L', 'remote_host': 'localhost',
             'ssh_server': 'my-ml-instance.ml.aws.com'
         }
     }
     add_command = AddCommand("image-processing", None, "L",
                              "localhost", None, None,
                              "my-ml-instance.ml.aws.com", None, None, None)
     self.assertEqual("49152", add_command.generate_consistent_target(targets)["remote_port"])
示例#3
0
 def test_raise_exception_with_inadiquate_parameters(self):
     add_command = AddCommand("image-processing", None, "L",
                              "localhost", None, "8888",
                              None, None, None, None)
     self.assertRaises(RuntimeError, lambda: add_command.generate_consistent_target({}))