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

Test query host by ID #268

Merged
merged 2 commits into from
May 30, 2019
Merged

Conversation

Glutexo
Copy link
Collaborator

@Glutexo Glutexo commented May 9, 2019

The plain /hosts/{host_id_list} query has not had any tests yet. Added some testing:

  • Regular queries for a single and multiple hosts
  • Queries with valid, but non-existent IDs
  • Invalid queries

This complements the create hosts tests of UUID validation. Reused the existing pagination tests.

This is a part of fixes for #265. Related to #92.

@Glutexo Glutexo self-assigned this May 9, 2019
Copy link
Collaborator

@dehort dehort left a comment

Choose a reason for hiding this comment

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

I believe some of these tests overlap with some tests in the QueryTestCase (test_query_using_host_id_list, test_query_using_host_id_list_include_nonexistent_host_ids, etc).

However, I like the approach of moving these tests into their own class. This makes the purpose of these tests more clear and should allow for easier splitting of these tests into their own files, etc later on.

Please remove the duplicated tests from QueryTestCase class and add the other host_id_list query related (tests test_query_using_host_id_list_one_host_id_does_not_include_hyphens) to this new class.

@Glutexo Glutexo requested a review from dehort May 24, 2019 12:53
@Glutexo
Copy link
Collaborator Author

Glutexo commented May 24, 2019

Aaaaargh, a conflict!

The plain /hosts/{host_id_list} query has not had any tests yet. Added
some testing:

* Regular queries for a single and multiple hosts
* Queries with valid, but non-existent IDs
* Invalid queries

This complements the create hosts tests of UUID validation. Reused the
existing pagination tests.
The tests in QueryTestCase overlaps to some extent with new tests in
QueryByHostIdTestCase. Removed those from QueryTestCase that are now
completely redundant and moved those that test getting hosts by ID list
to QueryByHostIdTestCase. Now, there are related tests in separate
classes, entropy is lower.
@Glutexo
Copy link
Collaborator Author

Glutexo commented May 24, 2019

Resolved. 🎉

Copy link
Collaborator

@dehort dehort left a comment

Choose a reason for hiding this comment

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

I like it.

@dehort dehort merged commit b0bafed into RedHatInsights:master May 30, 2019
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.

None yet

2 participants