def test_number3(self, mockconnection, mockinput): mocksql = mock.Mock() mocksql.cursor().commit.return_value = True 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_3() assert m is True
def test_number3_exception(self, mockconnection, mockinput): mocksql = mock.Mock() mocksql.cursor().execute.side_effect = sqlite3.Error g = Admin(mocksql, 1) m = g.number_3() assert m is False