-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Adds Regression Test By Mocking Input #32
Conversation
@@ -48,3 +48,6 @@ def paging(service, request_func, num_retries=5, **kwargs): | |||
has_next = False | |||
yield response | |||
# [END paging] | |||
|
|||
def get_input(text): | |||
return input(text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonparrott has an opinion on this!
input
trusts the input and eval it, maybe we should just use raw_input here.
Correct me if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@waprin is fixing it, and removing get_input all together in favor of directly mocking raw_input.
Adds Regression Test By Mocking Input
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 472561635 Source-Link: googleapis/googleapis@332ecf5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4313d682880fd9d7247291164d4e9d3d5bd9f177 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 472561635 Source-Link: googleapis/googleapis@332ecf5 Source-Link: googleapis/googleapis-gen@4313d68 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [google-cloud-scheduler](https://togithub.com/googleapis/python-scheduler) | major | `==1.3.0` -> `==2.0.0` | --- ### Release Notes <details> <summary>googleapis/python-scheduler</summary> ### [`v2.0.0`](https://togithub.com/googleapis/python-scheduler/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgoogleapispython-schedulercomparev130v200-2020-08-27) [Compare Source](https://togithub.com/googleapis/python-scheduler/compare/v1.3.0...v2.0.0) ##### ⚠ BREAKING CHANGES - migrate to microgenerator ([#​29](https://togithub.com/googleapis/python-scheduler/issues/29)) ##### Features - migrate to microgenerator ([#​29](https://www.github.com/googleapis/python-scheduler/issues/29)) ([82f66ed](https://www.github.com/googleapis/python-scheduler/commit/82f66ed9c163b2f6597bf5661469ca9ca1bef741)) ##### Bug Fixes - update retry configs ([#​20](https://www.github.com/googleapis/python-scheduler/issues/20)) ([7f82c9f](https://www.github.com/googleapis/python-scheduler/commit/7f82c9ffc292d72907de66bf6d5fa39e38d26085)) </details> --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-scheduler).
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [google-cloud-scheduler](https://togithub.com/googleapis/python-scheduler) | major | `==1.3.0` -> `==2.0.0` | --- ### Release Notes <details> <summary>googleapis/python-scheduler</summary> ### [`v2.0.0`](https://togithub.com/googleapis/python-scheduler/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgoogleapispython-schedulercomparev130v200-2020-08-27) [Compare Source](https://togithub.com/googleapis/python-scheduler/compare/v1.3.0...v2.0.0) ##### ⚠ BREAKING CHANGES - migrate to microgenerator ([#​29](https://togithub.com/googleapis/python-scheduler/issues/29)) ##### Features - migrate to microgenerator ([#​29](https://www.github.com/googleapis/python-scheduler/issues/29)) ([82f66ed](https://www.github.com/googleapis/python-scheduler/commit/82f66ed9c163b2f6597bf5661469ca9ca1bef741)) ##### Bug Fixes - update retry configs ([#​20](https://www.github.com/googleapis/python-scheduler/issues/20)) ([7f82c9f](https://www.github.com/googleapis/python-scheduler/commit/7f82c9ffc292d72907de66bf6d5fa39e38d26085)) </details> --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-scheduler).
If someone checked out origin/master and ran the samples, they immediately hit a string concatenation error. While an easy fix, I generally think it's a good idea, if possible, to write a failing test that then passes along with the bug fix. This is slightly awkward when getting user input is involved, but here's a pass at it, let me know what you think.