def testCheckContentForRowIdentifiedByWhereClause(self): dbDriver = DBDriverMock() sut = Pydblibrary() sut.connect_to_database(dbDriver, 'someDbName', 'someUsername', 'somePassword', 'someHost', '7777') responses = {"select id,name,surname from employee where name='John'": [(0, 'John', 'Doe')]} dbDriver.connection.cursor().setQueryResponses(responses) sut.check_content_for_row_identified_by_where_clause( ['id', 'name', 'surname'], [0, 'John', 'Doe'], 'employee', "name='John'")
def testCheckContentForRowIdentifiedByWhereClause(self): dbDriver = DBDriverMock() sut = Pydblibrary() sut.connect_to_database(dbDriver, 'someDbName', 'someUsername', 'somePassword', 'someHost', '7777') responses = { "select id,name,surname from employee where name='John'": [(0, 'John', 'Doe')] } dbDriver.connection.cursor().setQueryResponses(responses) sut.check_content_for_row_identified_by_where_clause( ['id', 'name', 'surname'], [0, 'John', 'Doe'], 'employee', "name='John'")