class TestCouchDBBackend(BackendTestBase, TestCase): def setUp(self): self.db = CouchDBBackend( host='http://*****:*****@mock.patch('daybed.backends.couchdb.CouchDBBackend.__init__') def test_load_from_config(self, constructor_mock): constructor_mock.return_value = None config = mock.MagicMock() CouchDBBackend.load_from_config(config) self.assertTrue(constructor_mock.called)
def setUp(self): self.db = CouchDBBackend( host='http://localhost:5984', db_name='test_%s' % uuid4(), id_generator=self.id_generator ) super(TestCouchDBBackend, self).setUp()
def setUp(self): self.db = CouchDBBackend( host='http://localhost:5984', db_name='test_%s' % uuid4(), id_generator=lambda: six.text_type(uuid4()) ) super(TestCouchDBBackend, self).setUp()
class TestCouchDBBackend(BackendTestBase, TestCase): def setUp(self): self.db = CouchDBBackend(host='http://*****:*****@mock.patch('daybed.backends.couchdb.CouchDBBackend.__init__') def test_load_from_config(self, constructor_mock): constructor_mock.return_value = None config = mock.MagicMock() CouchDBBackend.load_from_config(config) self.assertTrue(constructor_mock.called)
def test_load_from_config(self, constructor_mock): constructor_mock.return_value = None config = mock.MagicMock() CouchDBBackend.load_from_config(config) self.assertTrue(constructor_mock.called)
def test_server_unreachable(self): with self.assertRaises(CouchDBBackendConnectionError): CouchDBBackend(host='http://unreachable', db_name='daybed', id_generator=self.id_generator)
def setUp(self): self.db = CouchDBBackend(host='http://localhost:5984', db_name='test_%s' % uuid4(), id_generator=self.id_generator) super(TestCouchDBBackend, self).setUp()