Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test and fix for multidicts' .items(), .keys() and .values() repr #413

Merged
merged 3 commits into from
Jun 16, 2015

Conversation

popravich
Copy link
Member

abc.ItemsView / KeysView / ValuesView has __repr__ method but it expects that data is stored in ._mapping attribute.

First commit is failing test, second -- the fix.

@@ -305,6 +305,9 @@ def __init__(self, items):
def __len__(self):
return len(self._items)

def __repr__(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess _multidict.pyx also need __repr__ for _ViewBase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for sure)
I must say that test_muldict.py is almost as complicated as aiohttp parsers...
Can you point me where should I put tests for cython's multidict?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I suggest pushing along with test___repr__: https://github.com/KeepSafe/aiohttp/blob/master/tests/test_multidict.py#L269

Maybe I should refactor multidicts' test hierarchy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests already there

@popravich popravich force-pushed the multidict_repr_fixes branch from 9ba55a1 to 9bce9e5 Compare June 16, 2015 10:08
@popravich
Copy link
Member Author

Also fixed a typo in _multidict.pyx

asvetlov added a commit that referenced this pull request Jun 16, 2015
Test and fix for multidicts' .items(), .keys() and .values() repr
@asvetlov asvetlov merged commit d1b7e1c into master Jun 16, 2015
@asvetlov asvetlov deleted the multidict_repr_fixes branch June 16, 2015 15:18
@asvetlov
Copy link
Member

Thanks!

@lock
Copy link

lock bot commented Oct 30, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants