def test_addnewtime_exception(self, mockconnection, mockinput): mocksql = mock.Mock() mocksql.cursor().execute.side_effect = sqlite3.Error g = Admin(mocksql, 1) m = g.add_new_time() assert m is False
def test_addnewtime(self, mockconnection, mockinput): mocksql = mock.Mock() mocksql.cursor().commit.return_value = True g = Admin(mocksql, 1) m = g.add_new_time() assert m is True