Skip to content

Commit

Permalink
Merge pull request #85 from digitalocean/fix-circuit-term-repr
Browse files Browse the repository at this point in the history
Fix circuit term repr
  • Loading branch information
Zach Moody committed Aug 3, 2018
2 parents f450ebf + 111185e commit 70b88e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pynetbox/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ class Circuits(Record):

def __str__(self):
return self.cid


class CircuitTerminations(Record):

def __str__(self):
return self.circuit.cid
8 changes: 8 additions & 0 deletions tests/test_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit 70b88e8

Please sign in to comment.