def test_exception_if_table_does_not_exist(self): table = mock.Mock(spec=Table) table.name = 'users' db = Db([table]) with self.assertRaises(Exception): db.insert('despacito', id=2)
def test_insert(self): table = mock.Mock(spec=Table) table.name = 'users' db = Db([table]) db.insert('users', id=2, name='Roger') table.insert.assert_called_once_with(id=2, name='Roger')