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

Fixed broken unit tests: test_mssqlcliclient.py and test_completion_refresher.py #258

Merged
merged 2 commits into from
Jul 29, 2019

Conversation

geleems
Copy link

@geleems geleems commented Jul 27, 2019

Fixed broken unit tests (test_mssqlcliclient.py and test_completion_refresher.py)

Failed unit tests in test_mssqlcliclient.py

  • test_schema_table_views_and_columns_query
    • Cause: client.get_views() failed to retrieve list of views since it uses query with where clause WHERE table_type = 'View' that returns nothing on case-sensitive database
    • Fix: Remove the where clause and look up INFORMATION_SCHEMA.VIEWS instead of INFORMATION_SCHEMA.TABLES

Failed unit tests in test_completion_refresher.py

  • test_ctor

    • Causes:
      • refresher.refreshers.keys() returns only 5 refresher names defined in completion_refresher.py
      • set comparison should have been used instead of list comparison to verify if all elements of A are in B and all elements of B are in A
    • Fix
      • Update the expected_handlers with appropriate refreshers
      • Use set comparison instead of list
  • test_refresh_with_callbacks

    • Cause: it used wrong mock object for mssqlcliclient which blows up when mssqlcliclient.connect_to_database() is called.
    • Fix: Create and use mock object for mssqlcliclient with connect_to_database() implementation.

Changed use unit test framework unittest since class type unit test that extends unittest.TestCase (such as test_mssqlcliclient.py) are a lot more convenient to run and manage.

@geleems geleems requested a review from pensivebrian July 27, 2019 01:50
@geleems geleems self-assigned this Jul 27, 2019
Copy link
Member

@pensivebrian pensivebrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a little more to the description? What the issue was, and how the PR fixes the issue?

tests/test_completion_refresher.py Show resolved Hide resolved
tests/test_completion_refresher.py Outdated Show resolved Hide resolved
@geleems geleems requested a review from pensivebrian July 29, 2019 18:59
Copy link
Member

@pensivebrian pensivebrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the main description about the issue and how this PR fixes the issues.

@geleems geleems merged commit 4e6af3b into master Jul 29, 2019
@geleems geleems deleted the gelee/tf branch July 30, 2019 20:13
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.

2 participants