示例#1
0
 def test_fetchmany_wrapped_is_called_and_returned(self):
     cursor = self.cursor
     cursor.rowcount = 0
     cursor.fetchmany.return_value = '__result__'
     pin = Pin('pin_name', tracer=self.tracer)
     traced_cursor = FetchTracedCursor(cursor, pin, {})
     assert '__result__' == traced_cursor.fetchmany('arg_1',
                                                    kwarg1='kwarg1')
     cursor.fetchmany.assert_called_once_with('arg_1', kwarg1='kwarg1')
示例#2
0
 def test_fetchmany_wrapped_is_called_and_returned(self):
     cursor = self.cursor
     cursor.rowcount = 0
     cursor.fetchmany.return_value = "__result__"
     pin = Pin("pin_name", tracer=self.tracer)
     traced_cursor = FetchTracedCursor(cursor, pin, {})
     assert "__result__" == traced_cursor.fetchmany("arg_1",
                                                    kwarg1="kwarg1")
     cursor.fetchmany.assert_called_once_with("arg_1", kwarg1="kwarg1")