Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the UT for viptela #120

Merged
merged 1 commit into from
Feb 22, 2024
Merged

Fix the UT for viptela #120

merged 1 commit into from
Feb 22, 2024

Conversation

Taarini
Copy link
Contributor

@Taarini Taarini commented Feb 22, 2024

Fix the mock for the raw response

======================================================================
ERROR: test_delete_connected (test_viptela.test_rest_connector.test_delete_connected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "xxx/rest/src/rest/connector/tests/test_viptela.py", line 150, in test_delete_connected
    connection.delete(mount_point='temp')
  File "xxx/pyats/pkgs/async-pkg/src/pyats/async_/synchronize.py", line 117, in _wrapped
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/rest/src/rest/connector/libs/viptela/implementation.py", line 335, in delete
    log.info("Output received:\n{response}".format(response=response))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/yang/ncdiff/src/yang/ncdiff/__init__.py", line 69, in _str_response
    if self.raw.version in http_versions:
       ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'version'

======================================================================
ERROR: test_delete_connected_change_expected (test_viptela.test_rest_connector.test_delete_connected_change_expected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "xxx/rest/src/rest/connector/tests/test_viptela.py", line 169, in test_delete_connected_change_expected
    connection.delete(mount_point='temp')
  File "xxx/pyats/pkgs/async-pkg/src/pyats/async_/synchronize.py", line 117, in _wrapped
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/rest/src/rest/connector/libs/viptela/implementation.py", line 335, in delete
    log.info("Output received:\n{response}".format(response=response))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/yang/ncdiff/src/yang/ncdiff/__init__.py", line 69, in _str_response
    if self.raw.version in http_versions:
       ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'version'

======================================================================
ERROR: test_get_connected (test_viptela.test_rest_connector.test_get_connected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "xxx/rest/src/rest/connector/tests/test_viptela.py", line 108, in test_get_connected
    connection.get(mount_point='temp')
  File "xxx/pyats/pkgs/async-pkg/src/pyats/async_/synchronize.py", line 117, in _wrapped
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/rest/src/rest/connector/libs/viptela/implementation.py", line 210, in get
    log.info("Output received:\n{response}".format(response=response))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/yang/ncdiff/src/yang/ncdiff/__init__.py", line 69, in _str_response
    if self.raw.version in http_versions:
       ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'version'

======================================================================
ERROR: test_get_connected_change_expected (test_viptela.test_rest_connector.test_get_connected_change_expected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "xxx/rest/src/rest/connector/tests/test_viptela.py", line 128, in test_get_connected_change_expected
    connection.get(mount_point='temp')
  File "xxx/pyats/pkgs/async-pkg/src/pyats/async_/synchronize.py", line 117, in _wrapped
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/rest/src/rest/connector/libs/viptela/implementation.py", line 210, in get
    log.info("Output received:\n{response}".format(response=response))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/yang/ncdiff/src/yang/ncdiff/__init__.py", line 69, in _str_response
    if self.raw.version in http_versions:
       ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'version'

======================================================================
ERROR: test_post_connected (test_viptela.test_rest_connector.test_post_connected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "xxx/rest/src/rest/connector/tests/test_viptela.py", line 87, in test_post_connected
    connection.post(mount_point='temp',
  File "xxx/pyats/pkgs/async-pkg/src/pyats/async_/synchronize.py", line 117, in _wrapped
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/rest/src/rest/connector/libs/viptela/implementation.py", line 253, in post
    log.info("Output received:\n{response}".format(response=response))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/yang/ncdiff/src/yang/ncdiff/__init__.py", line 69, in _str_response
    if self.raw.version in http_versions:
       ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'version'

----------------------------------------------------------------------

Fix the mock for the raw response
@Taarini Taarini requested a review from a team as a code owner February 22, 2024 18:28
@Taarini Taarini merged commit 26459a1 into master Feb 22, 2024
8 checks passed
lsheikal pushed a commit that referenced this pull request Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants