nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: digitalocean/pynetbox
Pull request #85 (2018-08-03 21:05:57)

Fix circuit term repr


Patch:
diff --git a/pynetbox/circuits.py b/pynetbox/circuits.py
index 7785cad..6072c81 100644
--- a/pynetbox/circuits.py
+++ b/pynetbox/circuits.py
@@ -20,3 +20,9 @@ class Circuits(Record):
 
     def __str__(self):
         return self.cid
+
+
+class CircuitTerminations(Record):
+
+    def __str__(self):
+        return self.circuit.cid


Test patch:
diff --git a/tests/test_circuits.py b/tests/test_circuits.py
index b95cc71..068ffeb 100644
--- a/tests/test_circuits.py
+++ b/tests/test_circuits.py
@@ -111,3 +111,11 @@ class CircuitTypeTestCase(unittest.TestCase, GenericTest):
 
 class CircuitTerminationsTestCase(unittest.TestCase, GenericTest):
     name = 'circuit_terminations'
+
+    @patch(
+        'pynetbox.lib.query.requests.get',
+        return_value=Response(fixture='circuits/circuit_termination.json')
+    )
+    def test_repr(self, _):
+        test = nb.circuit_terminations.get(1)
+        self.assertEqual(str(test), '123456')