Repository: kytos/kytos

Issue:
Improve key generation for mock `Link.metadata`
The following test code in does not sufficiently expose kytos/pathfinder#64:

https://github.com/kytos/kytos/blob/c67933ccecd8c87eab9a7d527312956841959b97/kytos/lib/helpers.py#L34-L40

This change is to address the problem of the referenced bug not showing up for single-letter link attribute names.

Discussion:

Patch:
diff --git a/kytos/lib/helpers.py b/kytos/lib/helpers.py
index 1f9b771..5c12f86 100644
--- a/kytos/lib/helpers.py
+++ b/kytos/lib/helpers.py
@@ -36,7 +36,7 @@ def get_link_mock(endpoint_a, endpoint_b):
     link = create_autospec(Link)
     link.endpoint_a = endpoint_a
     link.endpoint_b = endpoint_b
-    link.metadata = {"A": 0}
+    link.metadata = {"A": 0, "BB": 0.0, "CCC": "test"}
     return link
 
 


Test patch:
diff --git a/tests/unit/test_lib/test_helpers.py b/tests/unit/test_lib/test_helpers.py
index 253fe54..48b339d 100644
--- a/tests/unit/test_lib/test_helpers.py
+++ b/tests/unit/test_lib/test_helpers.py
@@ -41,7 +41,8 @@ class TestHelpers(TestCase):
 
         self.assertEqual(link_mock.endpoint_a, endpoint_a)
         self.assertEqual(link_mock.endpoint_b, endpoint_b)
-        self.assertEqual(link_mock.metadata, {"A": 0})
+        self.assertEqual(link_mock.metadata, {"A": 0, "BB": 0.0,
+                                              "CCC": "test"})
 
     def test_switch_mock(self):
         """Test switch mock."""