def test_get_ssh_keys(self):
     self.provider.get_ssh_keys.return_value = [
         SSHKey.from_dict({'id': 1, 'name': 'abc'}),
         SSHKey.from_dict({'id': 32, 'name': 'bcd'})]
     self.assertEqual(
         self.cmd.get_do_ssh_keys(),
         [1, 32])
Пример #2
0
 def test_get_ssh_keys(self):
     self.provider.get_ssh_keys.return_value = [
         SSHKey.from_dict({
             'id': 1,
             'name': 'abc'
         }),
         SSHKey.from_dict({
             'id': 32,
             'name': 'bcd'
         })
     ]
     self.assertEqual(self.cmd.get_do_ssh_keys(), [1, 32])
Пример #3
0
 def setup_env(self, conf=None):
     self.provider.get_ssh_keys.return_value = [SSHKey.from_dict({"id": 1, "name": "abc"})]
     self.config.series = "precise"
     with tempfile.NamedTemporaryFile(delete=False) as f:
         self.config.get_env_conf.return_value = f.name
         self.config.get_env_name.return_value = "docean"
         if conf is None:
             conf = {"environments": {"docean": {"type": "null", "bootstrap-host": None}}}
         f.write(yaml.safe_dump(conf))
         f.flush()
         self.addCleanup(lambda: os.remove(f.name))
 def setup_env(self, conf=None):
     self.provider.get_ssh_keys.return_value = [
         SSHKey.from_dict({'id': 1, 'name': 'abc'})]
     self.config.series = "precise"
     with tempfile.NamedTemporaryFile(delete=False) as f:
         self.config.get_env_conf.return_value = f.name
         self.config.get_env_name.return_value = 'docean'
         if conf is None:
             conf = {
                 'environments': {
                     'docean': {
                         'type': 'null',
                         'bootstrap-host': None}}}
         f.write(yaml.safe_dump(conf))
         f.flush()
         self.addCleanup(lambda: os.remove(f.name))
Пример #5
0
 def setup_env(self, conf=None):
     self.provider.get_ssh_keys.return_value = [
         SSHKey.from_dict({
             'id': 1,
             'name': 'abc'
         })
     ]
     self.config.series = "precise"
     with tempfile.NamedTemporaryFile(delete=False) as f:
         self.config.get_env_conf.return_value = f.name
         self.config.get_env_name.return_value = 'docean'
         if conf is None:
             conf = {
                 'environments': {
                     'docean': {
                         'type': 'null',
                         'bootstrap-host': None
                     }
                 }
             }
         f.write(yaml.safe_dump(conf))
         f.flush()
         self.addCleanup(lambda: os.remove(f.name))
Пример #6
0
 def test_get_ssh_keys(self):
     self.provider.get_ssh_keys.return_value = [
         SSHKey.from_dict({"id": 1, "name": "abc"}),
         SSHKey.from_dict({"id": 32, "name": "bcd"}),
     ]
     self.assertEqual(self.cmd.get_do_ssh_keys(), [1, 32])