Skip to content

Commit

Permalink
Merge ca10298 into f2433e5
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed May 26, 2022
2 parents f2433e5 + ca10298 commit 7997f83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocs/ocs_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ def __init__(self, instance_id, **kwargs):
setattr(self, _opname_to_attr(name),
_get_op('process', name, encoded, self._client))

def __repr__(self):
return f"OCSClient('{self.instance_id}')"


def _humanized_time(t):
if abs(t) < 1.:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_ocs_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ def test_matched_client_object(self):
assert hasattr(client, 'process_name')
assert hasattr(client, 'task_name')

@patch('ocs.site_config.get_control_client', fake_get_control_client)
def test_ocsclient_repr(self):
client = OCSClient('agent-id')
assert repr(client) == "OCSClient('agent-id')"


class TestOCSReply:
"""Test various scenarios in OCSReply decoding. Since the representation
Expand Down

0 comments on commit 7997f83

Please sign in to comment.