示例#1
0
 def test_generate_filename(self):
     connector = BaseDBConnector()
     filename = connector.generate_filename()
示例#2
0
 def test_init(self):
     connector = BaseDBConnector()
示例#3
0
 def test_settings(self):
     connector = BaseDBConnector()
     connector.settings
示例#4
0
 def test_generate_filename(self):
     connector = BaseDBConnector()
     self.assertIsNotNone(connector.generate_filename())
示例#5
0
 def test_settings(self):
     connector = BaseDBConnector()
     self.assertFalse(hasattr(connector, '_settings'))
     self.assertTrue(connector.settings)
     self.assertTrue(hasattr(connector, '_settings'))
示例#6
0
 def test_init_with_kwargs(self):
     connector = BaseDBConnector(FoO='bar')
     self.assertEqual(connector.foo, 'bar')
示例#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'])
示例#8
0
 def test_init(self):
     connector = BaseDBConnector()
     self.assertEqual(connector.database_name, DEFAULT_DB_ALIAS)
     self.assertTrue(connector.connection)