Change keys.extend(..) to keys.append(..) #65
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@hdiogenes
This fixes #64. This also updates test_update_links so its keys setup implementation matches update_links.
The unit test for update_links did not catch this error because it filled up the array differently:
test2 is
['a', 'p', 'p', 'l', 'e', 'b', 'a', 'n', 'a', 'n', 'a', 'g', 'r', 'a', 'p', 'e']
test3 is
['apple', 'banana', 'grape']
, as intended.In addition, it uses a helper method
get_link_mock
fromkytos.lib.helpers
to set up a topology, and this topology uses single-letter attributes for each of its links:And #64 does not occur if
update_links
works with links that have only single-letter attributes. Namely, this code would detect a difference in metadata names and throw anAssertionError
if it was working with multi-letter attributes:But each link has only one attribute and that attribute is a single letter. So the test sees the equal lists and incorrectly assumes that its method under test is working as expected.