Closed MarvinTorres closed 4 years ago
64 does not occur if update_links works with links that have only single-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.
If the tests can't expose the problem because they only test single-letter attributes, the PR could be more complete if you changed the tests so that they can break, so they could:
@hdiogenes The method that returns mock links with single-letter attributes is in the Kytos core. I will create an issue in the core repository.
@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.