Example #1
0
 def test_generate_filename(self):
     connector = BaseDBConnector()
     filename = connector.generate_filename()
Example #2
0
 def test_init(self):
     connector = BaseDBConnector()
Example #3
0
 def test_settings(self):
     connector = BaseDBConnector()
     connector.settings
Example #4
0
 def test_generate_filename(self):
     connector = BaseDBConnector()
     self.assertIsNotNone(connector.generate_filename())
Example #5
0
 def test_settings(self):
     connector = BaseDBConnector()
     self.assertFalse(hasattr(connector, '_settings'))
     self.assertTrue(connector.settings)
     self.assertTrue(hasattr(connector, '_settings'))
Example #6
0
 def test_init_with_kwargs(self):
     connector = BaseDBConnector(FoO='bar')
     self.assertEqual(connector.foo, 'bar')
Example #7
0
 def test_init_with_args(self, mocked_connections):
     connector = BaseDBConnector(database_name='foo')
     self.assertEqual(connector.database_name, 'foo')
     self.assertEqual(connector.connection, mocked_connections['foo'])
Example #8
0
 def test_init(self):
     connector = BaseDBConnector()
     self.assertEqual(connector.database_name, DEFAULT_DB_ALIAS)
     self.assertTrue(connector.connection)