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

API Tests: rename test & delete test #321

Merged
merged 3 commits into from
Sep 11, 2023
Merged

API Tests: rename test & delete test #321

merged 3 commits into from
Sep 11, 2023

Conversation

nh916
Copy link
Contributor

@nh916 nh916 commented Sep 6, 2023

Description

uncommented test and changed test name to be self documenting

Changes

  • uncommented test_create_api to allow it to be usable again
    • not a hugely important test, but we already have it so we can use it
      • if we need to eliminate tests later to lighten up maintenance, this can be a great place to remove because the API client is test throughout the SDK anyways
  • renamed functional test from test_api_cript_env_vars to test_create_api_with_none

Tests

Known Issues

Notes

Checklist

  • My name is on the list of contributors (CONTRIBUTORS.md) in the pull request source branch.
  • I have updated the documentation to reflect my changes.

@trunk-io
Copy link

trunk-io bot commented Sep 6, 2023

Merging to develop in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@nh916 nh916 requested a review from InnocentBug September 6, 2023 17:26
@nh916 nh916 changed the title small API test update API Tests rename test and uncomment test Sep 6, 2023
tests that when the cript.API is given None for host, api_token, storage_token that it can correctly
retrieve things from the env variable
tests that when the cript.API is given `None` for `host`, `api_token`, `storage_token`
that it can correctly retrieve them from the environment variables
"""
host_value = "http://development.api.mycriptapp.org/"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we have those exported in the env anyways?
When you run the tests?

It can be confusing, if you set your env variables to connect to staging and then you run the tests and they fail because development is down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but I thought this would be an easier way to write the tests so its modular and not dependent on the CI variables, so we can change the CI variables without this going off that it needs to be changed too. It is more self contained in the function, easier to read, and easier to write assertions for.

I can change it if we think getting it directly from the CI is better, it is not a huge deal to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we as knowledgable engineers that run the tests should be comfortable with ENV variables.
I'd like it consistent with them

Copy link
Contributor Author

@nh916 nh916 Sep 7, 2023

Choose a reason for hiding this comment

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

I think we as knowledgable engineers

I appreciate the vote of confidence, but let me tell you, I've made some of the dumbest mistakes before 😂

but yeah I can change it to depend on the environment instead of being in the function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done! ✅

tests/api/test_api.py Outdated Show resolved Hide resolved
@nh916 nh916 requested a review from InnocentBug September 7, 2023 18:29
@nh916 nh916 added the refactor label Sep 7, 2023
@nh916 nh916 changed the title API Tests rename test and uncomment test API Tests rename test and delete API instantiation test Sep 8, 2023
@nh916 nh916 changed the title API Tests rename test and delete API instantiation test API Tests: rename test & delete test Sep 8, 2023
@nh916 nh916 merged commit d72b40c into develop Sep 11, 2023
14 checks passed
@nh916 nh916 deleted the updating-tests branch September 11, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants