def test_employeedetails(self, mockconnection): 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.employee_details() assert m is True
def test_employeedetails_exception(self, mockconnection): mocksql = mock.Mock() mocksql.cursor().execute.side_effect = sqlite3.Error g = Admin(mocksql, 1) m = g.employee_details() assert m is False