Skip to content

feat: add "GET /services/types" - #11

Merged
uniqueg merged 3 commits into
devfrom
get_services_types
Nov 11, 2020
Merged

uniqueg merged 3 commits into
devfrom
get_services_types

Conversation

@ninsch3000

@ninsch3000 ninsch3000 commented Nov 11, 2020 •

Copy link
Copy Markdown
Contributor
  • add getServiceTypes controller for endpoint GET /services/types

Resolves #3

@ninsch3000
ninsch3000 requested a review from uniqueg November 11, 2020 12:23
with app.app_context():
res = getServiceTypes.__wrapped__()
assert res == []
# All written services have same type, we expect list of length 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this test enough or do we need to test for different types?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was first leaning to no, but now leaning to yes. Could be that someone refactors the controller in a way that it, e.g., always only returns a list of length 1 (e.g., the first or last service). We wouldn't have a test to catch this then. So yeah, would be good to have a test where two different services are returned. So can just copy this test and change the org or artifact for each, then check that the length of the returned services equals the length of the input list.

@uniqueg uniqueg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would just add the test you asked about. Otherwise it's perfect! :)

with app.app_context():
res = getServiceTypes.__wrapped__()
assert res == []
# All written services have same type, we expect list of length 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was first leaning to no, but now leaning to yes. Could be that someone refactors the controller in a way that it, e.g., always only returns a list of length 1 (e.g., the first or last service). We wouldn't have a test to catch this then. So yeah, would be good to have a test where two different services are returned. So can just copy this test and change the org or artifact for each, then check that the length of the returned services equals the length of the input list.

@uniqueg
uniqueg merged commit 9aab650 into dev Nov 11, 2020
@uniqueg
uniqueg deleted the get_services_types branch November 11, 2020 15:43
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.

Implement "GET /services/types"

2 participants