Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 committed Nov 9, 2022
1 parent 0bd7cfb commit 2061ab1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sonic-ycabled/tests/test_ycable.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

exception_output_expected= """\
Traceback (most recent call last):
File "/__w/1/s/sonic-ycabled/tests/test_ycable.py", line 357, in test_ycable_helper_class_run_loop_with_exception
File "/sonic/src/sonic-platform-daemons/sonic-ycabled/tests/test_ycable.py", line 357, in test_ycable_helper_class_run_loop_with_exception
Y_cable_cli_task.task_cli_worker()
File "/sonic-platform-daemons/sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py", line 3655, in task_cli_worker
File "/sonic/src/sonic-platform-daemons/sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py", line 3655, in task_cli_worker
sel = swsscommon.Select()
File "/usr/lib/python3.9/unittest/mock.py", line 1093, in __call__
return self._mock_call(*args, **kwargs)
Expand Down Expand Up @@ -365,16 +365,16 @@ def test_ycable_helper_class_run_loop_with_exception(self):
except Exception as e2:
expected_exception_join = e2


"""

#Handy debug Helpers or else use import logging
#f = open("newfile", "w")
f = open("newfile", "w")
#f.write(format(e2))
#f.write(format(m1))
#f.write(trace)
"""
f.write(trace)

assert(type(expected_exception_start) == type(expected_exception_join))
assert(expected_exception_start.args == expected_exception_join.args)
assert(exception_output_expected == str(trace))
assert("NotImplementedError" in str(trace) and "effect" in str(trace))
assert("sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py" in str(trace))
assert("line 3655" in str(trace))

0 comments on commit 2061ab1

Please sign in to comment.