Пример #1
0
 def test_get_auth_default_password(self):
     n = NodeDriver('foo')
     n.features = {'create_node': ['password']}
     auth = n._get_and_check_auth(None)
     self.assertTrue(isinstance(auth, NodeAuthPassword))
Пример #2
0
 def test_get_auth_password_but_given_ssh_key(self):
     n = NodeDriver('foo')
     n.features = {'create_node': ['password']}
     auth = NodeAuthSSHKey('publickey')
     self.assertRaises(LibcloudError, n._get_and_check_auth, auth)
Пример #3
0
 def test_get_auth_default_ssh_key(self):
     n = NodeDriver('foo')
     n.features = {'create_node': ['ssh_key']}
     self.assertEqual(None, n._get_and_check_auth(None))
Пример #4
0
 def test_get_auth_ssh(self):
     n = NodeDriver('foo')
     n.features = {'create_node': ['ssh_key']}
     auth = NodeAuthSSHKey('pubkey...')
     self.assertEqual(auth, n._get_and_check_auth(auth))
Пример #5
0
 def test_get_auth_password(self):
     n = NodeDriver('foo')
     n.features = {'create_node': ['password']}
     auth = NodeAuthPassword('password')
     self.assertEqual(auth, n._get_and_check_auth(auth))
Пример #6
0
 def test_get_auth_default_password(self):
     n = NodeDriver("foo")
     n.features = {"create_node": ["password"]}
     auth = n._get_and_check_auth(None)
     self.assertTrue(isinstance(auth, NodeAuthPassword))
Пример #7
0
 def test_get_auth_generates_password_but_given_nonsense(self):
     n = NodeDriver('foo')
     n.features = {'create_node': ['generates_password']}
     auth = "nonsense"
     self.assertRaises(LibcloudError, n._get_and_check_auth, auth)
Пример #8
0
 def test_get_auth_default_ssh_key(self):
     n = NodeDriver("foo")
     n.features = {"create_node": ["ssh_key"]}
     self.assertEqual(None, n._get_and_check_auth(None))
Пример #9
0
 def test_get_auth_password_but_given_ssh_key(self):
     n = NodeDriver("foo")
     n.features = {"create_node": ["password"]}
     auth = NodeAuthSSHKey("publickey")
     self.assertRaises(LibcloudError, n._get_and_check_auth, auth)
Пример #10
0
 def test_get_auth_password(self):
     n = NodeDriver("foo")
     n.features = {"create_node": ["password"]}
     auth = NodeAuthPassword("password")
     self.assertEqual(auth, n._get_and_check_auth(auth))
Пример #11
0
 def test_get_auth_ssh(self):
     n = NodeDriver("foo")
     n.features = {"create_node": ["ssh_key"]}
     auth = NodeAuthSSHKey("pubkey...")
     self.assertEqual(auth, n._get_and_check_auth(auth))
Пример #12
0
 def test_get_auth_generates_password_but_given_nonsense(self):
     n = NodeDriver("foo")
     n.features = {"create_node": ["generates_password"]}
     auth = "nonsense"
     self.assertRaises(LibcloudError, n._get_and_check_auth, auth)