コード例 #1
0
    def testCheckContentForRowIdentifiedByRownum(self):
        dbDriver = DBDriverMock()

        sut = Pydblibrary()

        sut.connect_to_database(dbDriver, 'someDbName', 'someUsername',
                                'somePassword', 'someHost', '7777')

        responses = {'select id,name,surname from employee':
                     [(0, 'John', 'Doe'), (1, 'Jane', 'Doe')]}

        dbDriver.connection.cursor().setQueryResponses(responses)

        sut.check_content_for_row_identified_by_rownum(
            ['id', 'name', 'surname'], [0, 'John', 'Doe'], 'employee', 1)
コード例 #2
0
    def testCheckContentForRowIdentifiedByRownum(self):
        dbDriver = DBDriverMock()

        sut = Pydblibrary()

        sut.connect_to_database(dbDriver, 'someDbName', 'someUsername',
                                'somePassword', 'someHost', '7777')

        responses = {
            'select id,name,surname from employee': [(0, 'John', 'Doe'),
                                                     (1, 'Jane', 'Doe')]
        }

        dbDriver.connection.cursor().setQueryResponses(responses)

        sut.check_content_for_row_identified_by_rownum(
            ['id', 'name', 'surname'], [0, 'John', 'Doe'], 'employee', 1)