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

Refactored clone_dependant #2

Closed
wants to merge 2 commits into from
Closed

Refactored clone_dependant #2

wants to merge 2 commits into from

Conversation

denisSurkov
Copy link
Contributor

@denisSurkov denisSurkov commented Feb 11, 2020

Old version: In case if Dependant model will change you have to add new lines to function
New version: Everything will be copied automatically

Fixing #4


# all fields from original represented in cloned
assert list(original_dependant.__dict__.keys()) == list(cloned_dependant.__dict__.keys())
assert list(original_dependant.__dict__.values()) == list(cloned_dependant.__dict__.values())
Copy link
Owner

Choose a reason for hiding this comment

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

Test fails here for me:

>       assert list(original_dependant.__dict__.values()) == list(cloned_dependant.__dict__.values())
E       AssertionError: assert [[],\n [],\n [],\n [],\n [],\n [<fastapi.dependencies.models.Dependant object at 0x1048eaf60>],\n [],\n 'ss',\n 'ss',\n 'aaa',\n 'ss',\n ['sss'],\n 'sss',\n 'some name',\n <function test_clone_dependant.<locals>.<lambda> at 0x10497e6a8>,\n False,\n 'some path',\n (<function test_clone_dependant.<locals>.<lambda> at 0x10497e6a8>, ('sss',))] == [[],\n [],\n [],\n [],\n [],\n [<fastapi.dependencies.models.Dependant object at 0x10498ef98>],\n [],\n 'ss',\n 'ss',\n 'aaa',\n 'ss',\n ['sss'],\n 'sss',\n 'some name',\n <function test_clone_dependant.<locals>.<lambda> at 0x10497e6a8>,\n False,\n 'some path',\n (<function test_clone_dependant.<locals>.<lambda> at 0x10497e6a8>, ('sss',))]

test_utils.py:26: AssertionError

@denisSurkov
Copy link
Contributor Author

up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants