Esempio n. 1
0
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)
Esempio n. 2
0
 def setUp(self):
     self.db = CouchDBBackend(
         host='http://localhost:5984',
         db_name='test_%s' % uuid4(),
         id_generator=self.id_generator
     )
     super(TestCouchDBBackend, self).setUp()
Esempio n. 3
0
 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()
Esempio n. 4
0
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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 def test_server_unreachable(self):
     with self.assertRaises(CouchDBBackendConnectionError):
         CouchDBBackend(host='http://unreachable',
                        db_name='daybed',
                        id_generator=self.id_generator)
Esempio n. 7
0
 def setUp(self):
     self.db = CouchDBBackend(host='http://localhost:5984',
                              db_name='test_%s' % uuid4(),
                              id_generator=self.id_generator)
     super(TestCouchDBBackend, self).setUp()
Esempio n. 8
0
 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)