-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[Asset] Add requirements.txt #1834
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
317c415
[Asset] Add quick start code for ExportAssets API
peter-zheng-g fd384db
[Asset] Minor fix on comment.
peter-zheng-g a653881
[Asset] Fix import for test.
peter-zheng-g 6f2587d
[Asset] Attempt to fix build error
peter-zheng-g b023db1
[Asset] Fix code style issue.
peter-zheng-g 54c3917
[Asset] Fix build failure
peter-zheng-g 0c657e5
[Asset] Minor fix
peter-zheng-g 5ef33e5
[Asset] Fix build failure
peter-zheng-g 76cdfbb
[Asset] Fix build failure
peter-zheng-g fc0fdbf
[Asset] Minor fix.
peter-zheng-g 95eca67
[Asset] Minor fix on license statement.
peter-zheng-g a500466
[Asset] Add requirements.txt
peter-zheng-g 11d9499
Merge branch 'master' into master
peter-zheng-g 6079f6b
[Asset] Tests: requirement.txt version correction and Python3 format.
peter-zheng-g 3a68917
Merge branch 'master' of https://github.com/peter-zheng-g/python-docs…
peter-zheng-g d6d7379
[Asset] Code style fix.
peter-zheng-g 2810ab3
Merge branch 'master' into master
peter-zheng-g b09eef2
[Asset] Fix code style
peter-zheng-g 384ffad
Merge branch 'master' into master
gguuss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,14 +15,15 @@ | |
| # limitations under the License. | ||
|
|
||
| import os | ||
| import time | ||
|
|
||
| from google.cloud import storage | ||
| import pytest | ||
|
|
||
| import quickstart_exportassets | ||
|
|
||
| PROJECT = os.environ['GCLOUD_PROJECT'] | ||
| BUCKET = 'bucket-for-assets' | ||
| BUCKET = 'assets-{}'.format(int(time.time())) | ||
|
|
||
|
|
||
| @pytest.fixture(scope='module') | ||
|
|
@@ -36,15 +37,16 @@ def asset_bucket(storage_client): | |
|
|
||
| try: | ||
| storage_client.delete_bucket(BUCKET) | ||
| except Exception: | ||
| pass | ||
| except Exception as e: | ||
| print('Failed to delete bucket{}'.format(BUCKET)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space between bucket and {}: |
||
| raise e | ||
|
|
||
| yield BUCKET | ||
|
|
||
|
|
||
| def test_export_assets(asset_bucket, capsys): | ||
| dump_file_path = "gs://", asset_bucket, "/assets-dump.txt" | ||
gguuss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| dump_file_path = 'gs://{}/assets-dump.txt'.format(asset_bucket) | ||
| quickstart_exportassets.export_assets(PROJECT, dump_file_path) | ||
| out, _ = capsys.readouterr() | ||
|
|
||
| assert "uri: \"gs://cai-prober-prod-for-assets/phython-test.txt\"" in out | ||
| assert dump_file_path in out | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| google-cloud-storage==1.13.0 | ||
| google-cloud-asset==0.1.1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.