Beispiel #1
0
 def test_ask_and_create_with_name(self, mock_decision):
     dec_ins = Mock()
     dec_ins.run.return_value = 'test_name'.strip()
     mock_decision.return_value = dec_ins
     DB.ask_and_create()
     self.assertTrue(os.path.isfile(os.path.join(self.path, 'test_name.db')))
     self.assertTrue(dec_ins.run.called)
Beispiel #2
0
 def test_ask_and_create_without_name(self, mock_decision):
     dec_ins = Mock()
     dec_ins.run.return_value = ''
     mock_decision.return_value = dec_ins
     DB.ask_and_create()
     self.assertTrue(os.path.isfile(os.path.join(self.path, settings.DB_NAME)))
     self.assertTrue(dec_ins.run.called)