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

Unwinding cases in Test_set_default_dataset_id and having better test separation #672

Merged
merged 5 commits into from
Feb 26, 2015

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Feb 20, 2015

NOTE: Has #668 as diffbase

Tests previously were mixing the logic of the 4 possible environments while the simple ordering of them in set_default_dataset_id() and now _determine_default_dataset_id().

This PR separates that logic and makes sure each environ helper is called in a specific order.

In order to do this it also introduces two one-line functions _get_production_dataset_id() and _get_gcd_dataset_id() in the implicit environ module.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 20, 2015
@dhermes dhermes added api: datastore Issues related to the Datastore API. testing labels Feb 20, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a09391e on dhermes:fix-_implicit_environ-tests into 56f60bb on GoogleCloudPlatform:master.

@@ -79,6 +86,16 @@ def compute_engine_id():
connection.close()


def _get_production_dataset_id():

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Also defining one-liner _get_production_dataset_id() and
_get_gcd_dataset_id() methods to mirror the app_engine_id()
and compute_engine_id() methods in _implicit_environ.
Also fixing unused dataset_id=None in _callFUT in
Test__get_gcd_dataset_id and Test__get_gcd_dataset_id.
Also adding the relative ordering parts to Test__determine_default_dataset_id.

Tests previously were mixing the logic of the 4 possible environments
while the simple ordering of them in set_default_dataset_id() and
now _determine_default_dataset_id().

This separates that logic and makes sure each environ helper is called
in a specific order.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 1dd6709 on dhermes:fix-_implicit_environ-tests into 0e41dc3 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author

dhermes commented Feb 25, 2015

@tseaver Issues remaining?

@tseaver
Copy link
Contributor

tseaver commented Feb 25, 2015

LGTM

dhermes added a commit that referenced this pull request Feb 26, 2015
Unwinding cases in Test_set_default_dataset_id and having better test separation
@dhermes dhermes merged commit d43c4a0 into googleapis:master Feb 26, 2015
@dhermes
Copy link
Contributor Author

dhermes commented Feb 26, 2015

Let's see if Travis is all the way back on track...

@dhermes dhermes deleted the fix-_implicit_environ-tests branch February 26, 2015 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement. testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants