Пример #1
0
 def test_delete(self):
     resource = EtcdResource(client_config={'host': 'localhost'},
                             resource_config={
                                 'name': 'foo-name',
                                 'id':
                                 '53eb39c5-ca18-4934-b82a-84a4df0dbaf5'
                             })
     with self.assertRaises(NotImplementedError):
         resource.delete()
Пример #2
0
 def test_etcd_resource_instance(self):
     resource = EtcdResource(client_config={'host': 'localhost'},
                             resource_config={
                                 'name': 'foo-name',
                                 'id':
                                 '53eb39c5-ca18-4934-b82a-84a4df0dbaf5'
                             })
     self.assertEqual(resource.resource_id,
                      '53eb39c5-ca18-4934-b82a-84a4df0dbaf5')
     self.assertEqual(resource.name, 'foo-name')
Пример #3
0
 def test_empty_resource_name(self):
     resource = EtcdResource(client_config={'host': 'localhost'})
     self.assertIsNone(resource.name)
Пример #4
0
 def test_valid_connection(self):
     resource = EtcdResource(client_config={'host': 'localhost'},
                             resource_config={'name': 'foo-name'})
     self.assertIsInstance(resource.connection, etcd3.Etcd3Client)
Пример #5
0
 def test_valid_client_config(self):
     resource = EtcdResource(client_config={'host': 'localhost'})
     self.assertEqual(resource.client_config, {'host': 'localhost'})
Пример #6
0
 def test_valid_resource_id(self):
     resource = EtcdResource(client_config={'host': 'localhost'},
                             resource_config={'name': 'foo-name'})
     self.assertIsNotNone(resource.resource_id)