def test_number2_exception(self, mockconnection, mockinput, mockfunc): mocksql = mock.Mock() mocksql.cursor().execute.side_effect = sqlite3.Error g = Admin(mocksql, 1) m = g.number_2() assert m is False
def test_number2(self, mockconnection, mockinput, mockfunc): mocksql = mock.Mock() mocksql.cursor().fetchall.return_value = [(1, 'shrey', 'shrey', 'Shreya', 'Bangalore', 560034, 27, None, None, None, 'shreya', 'shreya', 'shreya', 'shreya')] g = Admin(mocksql, 1) m = g.number_2() assert m is True