| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ class _PropertyMixin(object): | |||
| 25 | 25 | """Abstract mixin for cloud storage classes with associated propertties. | |
| 26 | 26 | ||
| 27 | 27 | Non-abstract subclasses should implement: | |
| 28 | - - connection | ||
| 28 | + - client | ||
| 29 | 29 | - path | |
| 30 | 30 | ||
| 31 | 31 | :type name: string | |
@@ -65,8 +65,8 @@ def reload(self, client=None): | |||
| 65 | 65 | """Reload properties from Cloud Storage. | |
| 66 | 66 | ||
| 67 | 67 | :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` | |
| 68 | - :param client: Optional. The client to use. If not passed, falls back | ||
| 69 | - to default connection. | ||
| 68 | + :param client: the client to use. If not passed, falls back to the | ||
| 69 | + ``client`` stored on the current object. | ||
| 70 | 70 | """ | |
| 71 | 71 | client = self._require_client(client) | |
| 72 | 72 | # Pass only '?projection=noAcl' here because 'acl' and related | |
@@ -111,8 +111,8 @@ def patch(self, client=None): | |||
| 111 | 111 | Updates the ``_properties`` with the response from the backend. | |
| 112 | 112 | ||
| 113 | 113 | :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` | |
| 114 | - :param client: Optional. The client to use. If not passed, falls back | ||
| 115 | - to default connection. | ||
| 114 | + :param client: the client to use. If not passed, falls back to the | ||
| 115 | + ``client`` stored on the current object. | ||
| 116 | 116 | """ | |
| 117 | 117 | client = self._require_client(client) | |
| 118 | 118 | # Pass '?projection=full' here because 'PATCH' documented not | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -359,7 +359,7 @@ def _require_client(self, client): | |||
| 359 | 359 | ||
| 360 | 360 | :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` | |
| 361 | 361 | :param client: the client to use. If not passed, falls back to the | |
| 362 | - ``client`` stored on the current object. | ||
| 362 | + ``client`` stored on the current ACL. | ||
| 363 | 363 | ||
| 364 | 364 | :rtype: :class:`gcloud.storage.client.Client` | |
| 365 | 365 | :returns: The client passed in or the currently bound client. | |
@@ -373,7 +373,7 @@ def reload(self, client=None): | |||
| 373 | 373 | ||
| 374 | 374 | :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` | |
| 375 | 375 | :param client: Optional. The client to use. If not passed, falls back | |
| 376 | - to default connection. | ||
| 376 | + to the ``client`` stored on the ACL's parent. | ||
| 377 | 377 | """ | |
| 378 | 378 | path = self.reload_path | |
| 379 | 379 | client = self._require_client(client) | |
@@ -394,7 +394,7 @@ def save(self, acl=None, client=None): | |||
| 394 | 394 | ||
| 395 | 395 | :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` | |
| 396 | 396 | :param client: Optional. The client to use. If not passed, falls back | |
| 397 | - to default connection. | ||
| 397 | + to the ``client`` stored on the ACL's parent. | ||
| 398 | 398 | """ | |
| 399 | 399 | if acl is None: | |
| 400 | 400 | acl = self | |
@@ -425,7 +425,7 @@ def clear(self, client=None): | |||
| 425 | 425 | ||
| 426 | 426 | :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` | |
| 427 | 427 | :param client: Optional. The client to use. If not passed, falls back | |
| 428 | - to default connection. | ||
| 428 | + to the ``client`` stored on the ACL's parent. | ||
| 429 | 429 | """ | |
| 430 | 430 | self.save([], client=client) | |
| 431 | 431 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ def test_client_is_abstract(self): | |||
| 42 | 42 | mixin = self._makeOne() | |
| 43 | 43 | self.assertRaises(NotImplementedError, lambda: mixin.client) | |
| 44 | 44 | ||
| 45 | - def test_reload_w_explicit_connection(self): | ||
| 45 | + def test_reload(self): | ||
| 46 | 46 | connection = _Connection({'foo': 'Foo'}) | |
| 47 | 47 | client = _Client(connection) | |
| 48 | 48 | derived = self._derivedClass('/path')() | |
@@ -70,7 +70,7 @@ def test__patch_property(self): | |||
| 70 | 70 | derived._patch_property('foo', 'Foo') | |
| 71 | 71 | self.assertEqual(derived._properties, {'foo': 'Foo'}) | |
| 72 | 72 | ||
| 73 | - def test_patch_w_explicit_connection(self): | ||
| 73 | + def test_patch(self): | ||
| 74 | 74 | connection = _Connection({'foo': 'Foo'}) | |
| 75 | 75 | client = _Client(connection) | |
| 76 | 76 | derived = self._derivedClass('/path')() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ def test_ctor_default_identifier(self): | |||
| 31 | 31 | self.assertEqual(entity.identifier, None) | |
| 32 | 32 | self.assertEqual(entity.get_roles(), set()) | |
| 33 | 33 | ||
| 34 | - def test_ctor_explicit_identifier(self): | ||
| 34 | + def test_ctor_w_identifier(self): | ||
| 35 | 35 | TYPE = 'type' | |
| 36 | 36 | ID = 'id' | |
| 37 | 37 | entity = self._makeOne(TYPE, ID) | |
@@ -509,7 +509,7 @@ def test_get_entities_nonempty(self): | |||
| 509 | 509 | entity = acl.entity(TYPE, ID) | |
| 510 | 510 | self.assertEqual(acl.get_entities(), [entity]) | |
| 511 | 511 | ||
| 512 | - def test_reload_missing_w_explicit_connection(self): | ||
| 512 | + def test_reload_missing(self): | ||
| 513 | 513 | # https://github.com/GoogleCloudPlatform/gcloud-python/issues/652 | |
| 514 | 514 | ROLE = 'role' | |
| 515 | 515 | connection = _Connection({}) | |
@@ -525,7 +525,7 @@ def test_reload_missing_w_explicit_connection(self): | |||
| 525 | 525 | self.assertEqual(kw[0]['method'], 'GET') | |
| 526 | 526 | self.assertEqual(kw[0]['path'], '/testing/acl') | |
| 527 | 527 | ||
| 528 | - def test_reload_empty_result_clears_local_w_explicit_connection(self): | ||
| 528 | + def test_reload_empty_result_clears_local(self): | ||
| 529 | 529 | ROLE = 'role' | |
| 530 | 530 | connection = _Connection({'items': []}) | |
| 531 | 531 | client = _Client(connection) | |
@@ -541,7 +541,7 @@ def test_reload_empty_result_clears_local_w_explicit_connection(self): | |||
| 541 | 541 | self.assertEqual(kw[0]['method'], 'GET') | |
| 542 | 542 | self.assertEqual(kw[0]['path'], '/testing/acl') | |
| 543 | 543 | ||
| 544 | - def test_reload_nonempty_result_w_explicit_connection(self): | ||
| 544 | + def test_reload_nonempty_result(self): | ||
| 545 | 545 | ROLE = 'role' | |
| 546 | 546 | connection = _Connection( | |
| 547 | 547 | {'items': [{'entity': 'allUsers', 'role': ROLE}]}) | |
@@ -557,7 +557,7 @@ def test_reload_nonempty_result_w_explicit_connection(self): | |||
| 557 | 557 | self.assertEqual(kw[0]['method'], 'GET') | |
| 558 | 558 | self.assertEqual(kw[0]['path'], '/testing/acl') | |
| 559 | 559 | ||
| 560 | - def test_save_none_set_none_passed_w_explicit_connection(self): | ||
| 560 | + def test_save_none_set_none_passed(self): | ||
| 561 | 561 | connection = _Connection() | |
| 562 | 562 | client = _Client(connection) | |
| 563 | 563 | acl = self._makeOne() | |
@@ -566,7 +566,7 @@ def test_save_none_set_none_passed_w_explicit_connection(self): | |||
| 566 | 566 | kw = connection._requested | |
| 567 | 567 | self.assertEqual(len(kw), 0) | |
| 568 | 568 | ||
| 569 | - def test_save_existing_missing_none_passed_w_explicit_connection(self): | ||
| 569 | + def test_save_existing_missing_none_passed(self): | ||
| 570 | 570 | connection = _Connection({}) | |
| 571 | 571 | client = _Client(connection) | |
| 572 | 572 | acl = self._makeOne() | |
@@ -581,7 +581,7 @@ def test_save_existing_missing_none_passed_w_explicit_connection(self): | |||
| 581 | 581 | self.assertEqual(kw[0]['data'], {'acl': []}) | |
| 582 | 582 | self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | |
| 583 | 583 | ||
| 584 | - def test_save_no_arg_w_explicit_connection(self): | ||
| 584 | + def test_save_no_arg(self): | ||
| 585 | 585 | ROLE = 'role' | |
| 586 | 586 | AFTER = [{'entity': 'allUsers', 'role': ROLE}] | |
| 587 | 587 | connection = _Connection({'acl': AFTER}) | |
@@ -599,7 +599,7 @@ def test_save_no_arg_w_explicit_connection(self): | |||
| 599 | 599 | self.assertEqual(kw[0]['data'], {'acl': AFTER}) | |
| 600 | 600 | self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | |
| 601 | 601 | ||
| 602 | - def test_save_w_arg_w_explicit_connection(self): | ||
| 602 | + def test_save_w_arg(self): | ||
| 603 | 603 | ROLE1 = 'role1' | |
| 604 | 604 | ROLE2 = 'role2' | |
| 605 | 605 | STICKY = {'entity': 'allUsers', 'role': ROLE2} | |
@@ -621,7 +621,7 @@ def test_save_w_arg_w_explicit_connection(self): | |||
| 621 | 621 | self.assertEqual(kw[0]['data'], {'acl': new_acl}) | |
| 622 | 622 | self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | |
| 623 | 623 | ||
| 624 | - def test_clear_w_explicit_connection(self): | ||
| 624 | + def test_clear(self): | ||
| 625 | 625 | ROLE1 = 'role1' | |
| 626 | 626 | ROLE2 = 'role2' | |
| 627 | 627 | STICKY = {'entity': 'allUsers', 'role': ROLE2} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,7 @@ def _getTargetClass(self): | |||
| 75 | 75 | def _makeOne(self, *args, **kw): | |
| 76 | 76 | return self._getTargetClass()(*args, **kw) | |
| 77 | 77 | ||
| 78 | - def test_ctor_w_explicit_connection(self): | ||
| 78 | + def test_ctor(self): | ||
| 79 | 79 | http = _HTTP() | |
| 80 | 80 | connection = _Connection(http=http) | |
| 81 | 81 | client = _Client(connection) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,7 +183,7 @@ def test_generate_signed_url_w_slash_in_name(self): | |||
| 183 | 183 | } | |
| 184 | 184 | self.assertEqual(SIGNER._signed, [(EXPECTED_ARGS, EXPECTED_KWARGS)]) | |
| 185 | 185 | ||
| 186 | - def test_generate_signed_url_w_explicit_method(self): | ||
| 186 | + def test_generate_signed_url_w_method_arg(self): | ||
| 187 | 187 | from gcloud._testing import _Monkey | |
| 188 | 188 | from gcloud.storage import blob as MUT | |
| 189 | 189 | ||
@@ -674,7 +674,7 @@ def test_upload_from_string_w_text(self): | |||
| 674 | 674 | self.assertEqual(headers['Content-Type'], 'text/plain') | |
| 675 | 675 | self.assertEqual(rq[0]['body'], ENCODED) | |
| 676 | 676 | ||
| 677 | - def test_make_public_w_explicit_connection(self): | ||
| 677 | + def test_make_public(self): | ||
| 678 | 678 | from gcloud.storage.acl import _ACLEntity | |
| 679 | 679 | BLOB_NAME = 'blob-name' | |
| 680 | 680 | permissive = [{'entity': 'allUsers', 'role': _ACLEntity.READER_ROLE}] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ def _getTargetClass(self): | |||
| 26 | 26 | def _makeOne(self, *args, **kw): | |
| 27 | 27 | return self._getTargetClass()(*args, **kw) | |
| 28 | 28 | ||
| 29 | - def test_ctor_w_explicit_connection(self): | ||
| 29 | + def test_ctor(self): | ||
| 30 | 30 | connection = _Connection() | |
| 31 | 31 | client = _Client(connection) | |
| 32 | 32 | bucket = _Bucket() | |
@@ -162,7 +162,7 @@ def api_request(cls, *args, **kwargs): | |||
| 162 | 162 | expected_cw = [((), expected_called_kwargs)] | |
| 163 | 163 | self.assertEqual(_FakeConnection._called_with, expected_cw) | |
| 164 | 164 | ||
| 165 | - def test_create_hit_explicit_project(self): | ||
| 165 | + def test_create_hit(self): | ||
| 166 | 166 | BUCKET_NAME = 'bucket-name' | |
| 167 | 167 | DATA = {'name': BUCKET_NAME} | |
| 168 | 168 | connection = _Connection(DATA) | |
@@ -238,7 +238,7 @@ def test_list_blobs_defaults(self): | |||
| 238 | 238 | self.assertEqual(kw['path'], '/b/%s/o' % NAME) | |
| 239 | 239 | self.assertEqual(kw['query_params'], {'projection': 'noAcl'}) | |
| 240 | 240 | ||
| 241 | - def test_list_blobs_explicit(self): | ||
| 241 | + def test_list_blobs_w_all_arguments(self): | ||
| 242 | 242 | NAME = 'name' | |
| 243 | 243 | MAX_RESULTS = 10 | |
| 244 | 244 | PAGE_TOKEN = 'ABCD' | |
@@ -276,7 +276,7 @@ def test_list_blobs_explicit(self): | |||
| 276 | 276 | self.assertEqual(kw['path'], '/b/%s/o' % NAME) | |
| 277 | 277 | self.assertEqual(kw['query_params'], EXPECTED) | |
| 278 | 278 | ||
| 279 | - def test_list_blobs_w_explicit_connection(self): | ||
| 279 | + def test_list_blobs(self): | ||
| 280 | 280 | NAME = 'name' | |
| 281 | 281 | connection = _Connection({'items': []}) | |
| 282 | 282 | client = _Client(connection) | |
@@ -289,7 +289,7 @@ def test_list_blobs_w_explicit_connection(self): | |||
| 289 | 289 | self.assertEqual(kw['path'], '/b/%s/o' % NAME) | |
| 290 | 290 | self.assertEqual(kw['query_params'], {'projection': 'noAcl'}) | |
| 291 | 291 | ||
| 292 | - def test_delete_default_miss(self): | ||
| 292 | + def test_delete_miss(self): | ||
| 293 | 293 | from gcloud.exceptions import NotFound | |
| 294 | 294 | NAME = 'name' | |
| 295 | 295 | connection = _Connection() | |
@@ -303,7 +303,7 @@ def test_delete_default_miss(self): | |||
| 303 | 303 | }] | |
| 304 | 304 | self.assertEqual(connection._deleted_buckets, expected_cw) | |
| 305 | 305 | ||
| 306 | - def test_delete_explicit_hit(self): | ||
| 306 | + def test_delete_hit(self): | ||
| 307 | 307 | NAME = 'name' | |
| 308 | 308 | GET_BLOBS_RESP = {'items': []} | |
| 309 | 309 | connection = _Connection(GET_BLOBS_RESP) | |
@@ -319,7 +319,7 @@ def test_delete_explicit_hit(self): | |||
| 319 | 319 | }] | |
| 320 | 320 | self.assertEqual(connection._deleted_buckets, expected_cw) | |
| 321 | 321 | ||
| 322 | - def test_delete_explicit_force_delete_blobs(self): | ||
| 322 | + def test_delete_force_delete_blobs(self): | ||
| 323 | 323 | NAME = 'name' | |
| 324 | 324 | BLOB_NAME1 = 'blob-name1' | |
| 325 | 325 | BLOB_NAME2 = 'blob-name2' | |
@@ -344,7 +344,7 @@ def test_delete_explicit_force_delete_blobs(self): | |||
| 344 | 344 | }] | |
| 345 | 345 | self.assertEqual(connection._deleted_buckets, expected_cw) | |
| 346 | 346 | ||
| 347 | - def test_delete_explicit_force_miss_blobs(self): | ||
| 347 | + def test_delete_force_miss_blobs(self): | ||
| 348 | 348 | NAME = 'name' | |
| 349 | 349 | BLOB_NAME = 'blob-name1' | |
| 350 | 350 | GET_BLOBS_RESP = {'items': [{'name': BLOB_NAME}]} | |
@@ -362,7 +362,7 @@ def test_delete_explicit_force_miss_blobs(self): | |||
| 362 | 362 | }] | |
| 363 | 363 | self.assertEqual(connection._deleted_buckets, expected_cw) | |
| 364 | 364 | ||
| 365 | - def test_delete_explicit_too_many(self): | ||
| 365 | + def test_delete_too_many(self): | ||
| 366 | 366 | NAME = 'name' | |
| 367 | 367 | BLOB_NAME1 = 'blob-name1' | |
| 368 | 368 | BLOB_NAME2 = 'blob-name2' | |
@@ -506,7 +506,7 @@ class _Blob(object): | |||
| 506 | 506 | self.assertEqual(kw['method'], 'POST') | |
| 507 | 507 | self.assertEqual(kw['path'], COPY_PATH) | |
| 508 | 508 | ||
| 509 | - def test_upload_file_default_blob(self): | ||
| 509 | + def test_upload_file_default_blob_name(self): | ||
| 510 | 510 | from gcloud._testing import _Monkey | |
| 511 | 511 | from gcloud.storage import bucket as MUT | |
| 512 | 512 | BASENAME = 'file.ext' | |
@@ -528,7 +528,7 @@ def upload_from_filename(self, filename, client=None): | |||
| 528 | 528 | bucket.upload_file(FILENAME) | |
| 529 | 529 | self.assertEqual(_uploaded, [(bucket, BASENAME, FILENAME, None)]) | |
| 530 | 530 | ||
| 531 | - def test_upload_file_explicit_blob(self): | ||
| 531 | + def test_upload_file_blob_w_blob_name(self): | ||
| 532 | 532 | from gcloud._testing import _Monkey | |
| 533 | 533 | from gcloud.storage import bucket as MUT | |
| 534 | 534 | FILENAME = '/path/to/file' | |
@@ -574,7 +574,7 @@ def upload_from_file(self, fh, client=None): | |||
| 574 | 574 | self.assertEqual(found._name, FILENAME) | |
| 575 | 575 | self.assertTrue(found._bucket is bucket) | |
| 576 | 576 | ||
| 577 | - def test_upload_file_object_explicit_blob(self): | ||
| 577 | + def test_upload_file_object_blob(self): | ||
| 578 | 578 | from gcloud._testing import _Monkey | |
| 579 | 579 | from gcloud.storage import bucket as MUT | |
| 580 | 580 | FILENAME = 'file.txt' | |
@@ -700,7 +700,7 @@ def test_enable_logging_defaults(self): | |||
| 700 | 700 | self.assertEqual(info['logBucket'], LOG_BUCKET) | |
| 701 | 701 | self.assertEqual(info['logObjectPrefix'], '') | |
| 702 | 702 | ||
| 703 | - def test_enable_logging_explicit(self): | ||
| 703 | + def test_enable_logging(self): | ||
| 704 | 704 | NAME = 'name' | |
| 705 | 705 | LOG_BUCKET = 'logs' | |
| 706 | 706 | LOG_PFX = 'pfx' | |
@@ -812,7 +812,7 @@ def test_configure_website_defaults(self): | |||
| 812 | 812 | bucket.configure_website() | |
| 813 | 813 | self.assertEqual(bucket._properties, UNSET) | |
| 814 | 814 | ||
| 815 | - def test_configure_website_explicit(self): | ||
| 815 | + def test_configure_website(self): | ||
| 816 | 816 | NAME = 'name' | |
| 817 | 817 | WEBSITE_VAL = {'website': {'mainPageSuffix': 'html', | |
| 818 | 818 | 'notFoundPage': '404.html'}} | |
| Back | FazBrowse Home | New Git URL |
0 commit comments