| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,19 +25,10 @@ class _PropertyMixin(object): | |||
| 25 | 25 | """Abstract mixin for cloud storage classes with associated propertties. | |
| 26 | 26 | ||
| 27 | 27 | Non-abstract subclasses should implement: | |
| 28 | - - CUSTOM_PROPERTY_ACCESSORS | ||
| 29 | 28 | - connection | |
| 30 | 29 | - path | |
| 31 | 30 | """ | |
| 32 | 31 | ||
| 33 | - CUSTOM_PROPERTY_ACCESSORS = None | ||
| 34 | - """Mapping of field name -> accessor for fields w/ custom accessors. | ||
| 35 | - | ||
| 36 | - Expected to be set by subclasses. Fields in this mapping will cause | ||
| 37 | - :meth:`_get_property()` to raise a KeyError with a message to use the | ||
| 38 | - relevant accessor methods. | ||
| 39 | - """ | ||
| 40 | - | ||
| 41 | 32 | @property | |
| 42 | 33 | def connection(self): | |
| 43 | 34 | """Abstract getter for the connection to use.""" | |
@@ -64,12 +55,11 @@ def __init__(self, name=None, properties=None): | |||
| 64 | 55 | ||
| 65 | 56 | @property | |
| 66 | 57 | def properties(self): | |
| 67 | - """Ensure properties are loaded, and return a copy. | ||
| 58 | + """Return a copy of properties. | ||
| 68 | 59 | ||
| 69 | 60 | :rtype: dict | |
| 61 | + :returns: Copy of properties. | ||
| 70 | 62 | """ | |
| 71 | - if not self._properties: | ||
| 72 | - self._reload_properties() | ||
| 73 | 63 | return self._properties.copy() | |
| 74 | 64 | ||
| 75 | 65 | @property | |
@@ -131,30 +121,6 @@ def _patch_properties(self, properties): | |||
| 131 | 121 | query_params={'projection': 'full'}) | |
| 132 | 122 | return self | |
| 133 | 123 | ||
| 134 | - def _get_property(self, field, default=None): | ||
| 135 | - """Return the value of a field from the server-side representation. | ||
| 136 | - | ||
| 137 | - If you request a field that isn't available, and that field can | ||
| 138 | - be retrieved by refreshing data from Cloud Storage, this method | ||
| 139 | - will reload the data using :func:`_PropertyMixin._reload_properties`. | ||
| 140 | - | ||
| 141 | - :type field: string | ||
| 142 | - :param field: A particular field to retrieve from properties. | ||
| 143 | - | ||
| 144 | - :type default: anything | ||
| 145 | - :param default: The value to return if the field provided wasn't found. | ||
| 146 | - | ||
| 147 | - :rtype: anything | ||
| 148 | - :returns: value of the specific field, or the default if not found. | ||
| 149 | - """ | ||
| 150 | - # Raise for fields which have custom accessors. | ||
| 151 | - custom = self.CUSTOM_PROPERTY_ACCESSORS.get(field) | ||
| 152 | - if custom is not None: | ||
| 153 | - message = "Use '%s' or related methods instead." % custom | ||
| 154 | - raise KeyError((field, message)) | ||
| 155 | - | ||
| 156 | - return self.properties.get(field, default) | ||
| 157 | - | ||
| 158 | 124 | ||
| 159 | 125 | class _PropertyBatch(object): | |
| 160 | 126 | """Context manager: Batch updates to object's ``_patch_properties`` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,29 +52,6 @@ class Blob(_PropertyMixin): | |||
| 52 | 52 | :param properties: All the other data provided by Cloud Storage. | |
| 53 | 53 | """ | |
| 54 | 54 | ||
| 55 | - CUSTOM_PROPERTY_ACCESSORS = { | ||
| 56 | - 'acl': 'acl', | ||
| 57 | - 'cacheControl': 'cache_control', | ||
| 58 | - 'contentDisposition': 'content_disposition', | ||
| 59 | - 'contentEncoding': 'content_encoding', | ||
| 60 | - 'contentLanguage': 'content_language', | ||
| 61 | - 'contentType': 'content_type', | ||
| 62 | - 'componentCount': 'component_count', | ||
| 63 | - 'etag': 'etag', | ||
| 64 | - 'generation': 'generation', | ||
| 65 | - 'id': 'id', | ||
| 66 | - 'mediaLink': 'media_link', | ||
| 67 | - 'metageneration': 'metageneration', | ||
| 68 | - 'name': 'name', | ||
| 69 | - 'owner': 'owner', | ||
| 70 | - 'selfLink': 'self_link', | ||
| 71 | - 'size': 'size', | ||
| 72 | - 'storageClass': 'storage_class', | ||
| 73 | - 'timeDeleted': 'time_deleted', | ||
| 74 | - 'updated': 'updated', | ||
| 75 | - } | ||
| 76 | - """Map field name -> accessor for fields w/ custom accessors.""" | ||
| 77 | - | ||
| 78 | 55 | CHUNK_SIZE = 1024 * 1024 # 1 MB. | |
| 79 | 56 | """The size of a chunk of data whenever iterating (1 MB). | |
| 80 | 57 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,26 +86,6 @@ class Bucket(_PropertyMixin): | |||
| 86 | 86 | _MAX_OBJECTS_FOR_BUCKET_DELETE = 256 | |
| 87 | 87 | """Maximum number of existing objects allowed in Bucket.delete().""" | |
| 88 | 88 | ||
| 89 | - CUSTOM_PROPERTY_ACCESSORS = { | ||
| 90 | - 'acl': 'acl', | ||
| 91 | - 'cors': 'get_cors()', | ||
| 92 | - 'defaultObjectAcl': 'get_default_object_acl()', | ||
| 93 | - 'etag': 'etag', | ||
| 94 | - 'id': 'id', | ||
| 95 | - 'lifecycle': 'get_lifecycle()', | ||
| 96 | - 'location': 'location', | ||
| 97 | - 'logging': 'get_logging()', | ||
| 98 | - 'metageneration': 'metageneration', | ||
| 99 | - 'name': 'name', | ||
| 100 | - 'owner': 'owner', | ||
| 101 | - 'projectNumber': 'project_number', | ||
| 102 | - 'selfLink': 'self_link', | ||
| 103 | - 'storageClass': 'storage_class', | ||
| 104 | - 'timeCreated': 'time_created', | ||
| 105 | - 'versioning': 'versioning_enabled', | ||
| 106 | - } | ||
| 107 | - """Map field name -> accessor for fields w/ custom accessors.""" | ||
| 108 | - | ||
| 109 | 89 | # ACL rules are lazily retrieved. | |
| 110 | 90 | _acl = _default_object_acl = None | |
| 111 | 91 | ||
@@ -594,6 +574,7 @@ def get_logging(self): | |||
| 594 | 574 | :returns: a dict w/ keys, ``logBucket`` and ``logObjectPrefix`` | |
| 595 | 575 | (if logging is enabled), or None (if not). | |
| 596 | 576 | """ | |
| 577 | + self._reload_properties() | ||
| 597 | 578 | info = self.properties.get('logging') | |
| 598 | 579 | if info is not None: | |
| 599 | 580 | return info.copy() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,10 +24,9 @@ def _getTargetClass(self): | |||
| 24 | 24 | def _makeOne(self, *args, **kw): | |
| 25 | 25 | return self._getTargetClass()(*args, **kw) | |
| 26 | 26 | ||
| 27 | - def _derivedClass(self, connection=None, path=None, **custom_fields): | ||
| 27 | + def _derivedClass(self, connection=None, path=None): | ||
| 28 | 28 | ||
| 29 | 29 | class Derived(self._getTargetClass()): | |
| 30 | - CUSTOM_PROPERTY_ACCESSORS = custom_fields | ||
| 31 | 30 | ||
| 32 | 31 | @property | |
| 33 | 32 | def connection(self): | |
@@ -39,18 +38,14 @@ def path(self): | |||
| 39 | 38 | ||
| 40 | 39 | return Derived | |
| 41 | 40 | ||
| 42 | - def test_connetction_is_abstract(self): | ||
| 41 | + def test_connection_is_abstract(self): | ||
| 43 | 42 | mixin = self._makeOne() | |
| 44 | 43 | self.assertRaises(NotImplementedError, lambda: mixin.connection) | |
| 45 | 44 | ||
| 46 | 45 | def test_path_is_abstract(self): | |
| 47 | 46 | mixin = self._makeOne() | |
| 48 | 47 | self.assertRaises(NotImplementedError, lambda: mixin.path) | |
| 49 | 48 | ||
| 50 | - def test_properties_eager(self): | ||
| 51 | - derived = self._derivedClass()(properties={'extant': False}) | ||
| 52 | - self.assertEqual(derived.properties, {'extant': False}) | ||
| 53 | - | ||
| 54 | 49 | def test_batch(self): | |
| 55 | 50 | connection = _Connection({'foo': 'Qux', 'bar': 'Baz'}) | |
| 56 | 51 | derived = self._derivedClass(connection, '/path')() | |
@@ -65,9 +60,11 @@ def test_batch(self): | |||
| 65 | 60 | self.assertEqual(kw[0]['data'], {'foo': 'Qux', 'bar': 'Baz'}) | |
| 66 | 61 | self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | |
| 67 | 62 | ||
| 68 | - def test_properties_lazy(self): | ||
| 63 | + def test_properties_no_fetch(self): | ||
| 69 | 64 | connection = _Connection({'foo': 'Foo'}) | |
| 70 | 65 | derived = self._derivedClass(connection, '/path')() | |
| 66 | + self.assertEqual(derived.properties, {}) | ||
| 67 | + derived._reload_properties() | ||
| 71 | 68 | self.assertEqual(derived.properties, {'foo': 'Foo'}) | |
| 72 | 69 | kw = connection._requested | |
| 73 | 70 | self.assertEqual(len(kw), 1) | |
@@ -86,40 +83,6 @@ def test__reload_properties(self): | |||
| 86 | 83 | self.assertEqual(kw[0]['path'], '/path') | |
| 87 | 84 | self.assertEqual(kw[0]['query_params'], {'projection': 'noAcl'}) | |
| 88 | 85 | ||
| 89 | - def test__get_property_eager_hit(self): | ||
| 90 | - derived = self._derivedClass()(properties={'foo': 'Foo'}) | ||
| 91 | - self.assertEqual(derived._get_property('foo'), 'Foo') | ||
| 92 | - | ||
| 93 | - def test__get_property_eager_miss_w_default(self): | ||
| 94 | - connection = _Connection({'foo': 'Foo'}) | ||
| 95 | - derived = self._derivedClass(connection, '/path')() | ||
| 96 | - default = object() | ||
| 97 | - self.assertTrue(derived._get_property('nonesuch', default) is default) | ||
| 98 | - kw = connection._requested | ||
| 99 | - self.assertEqual(len(kw), 1) | ||
| 100 | - self.assertEqual(kw[0]['method'], 'GET') | ||
| 101 | - self.assertEqual(kw[0]['path'], '/path') | ||
| 102 | - self.assertEqual(kw[0]['query_params'], {'projection': 'noAcl'}) | ||
| 103 | - | ||
| 104 | - def test__get_property_lazy_hit(self): | ||
| 105 | - connection = _Connection({'foo': 'Foo'}) | ||
| 106 | - derived = self._derivedClass(connection, '/path')() | ||
| 107 | - self.assertTrue(derived._get_property('nonesuch') is None) | ||
| 108 | - kw = connection._requested | ||
| 109 | - self.assertEqual(len(kw), 1) | ||
| 110 | - self.assertEqual(kw[0]['method'], 'GET') | ||
| 111 | - self.assertEqual(kw[0]['path'], '/path') | ||
| 112 | - self.assertEqual(kw[0]['query_params'], {'projection': 'noAcl'}) | ||
| 113 | - | ||
| 114 | - def test__get_property_w_custom_field(self): | ||
| 115 | - derived = self._derivedClass(foo='get_foo')() | ||
| 116 | - try: | ||
| 117 | - derived._get_property('foo') | ||
| 118 | - except KeyError as e: | ||
| 119 | - self.assertTrue('get_foo' in str(e)) | ||
| 120 | - else: # pragma: NO COVER | ||
| 121 | - self.assert_('KeyError not raised') | ||
| 122 | - | ||
| 123 | 86 | def test__patch_properties(self): | |
| 124 | 87 | connection = _Connection({'foo': 'Foo'}) | |
| 125 | 88 | derived = self._derivedClass(connection, '/path')() | |
@@ -141,11 +104,10 @@ def _getTargetClass(self): | |||
| 141 | 104 | def _makeOne(self, wrapped): | |
| 142 | 105 | return self._getTargetClass()(wrapped) | |
| 143 | 106 | ||
| 144 | - def _makeWrapped(self, connection=None, path=None, **custom_fields): | ||
| 107 | + def _makeWrapped(self, connection=None, path=None): | ||
| 145 | 108 | from gcloud.storage._helpers import _PropertyMixin | |
| 146 | 109 | ||
| 147 | 110 | class Wrapped(_PropertyMixin): | |
| 148 | - CUSTOM_PROPERTY_ACCESSORS = custom_fields | ||
| 149 | 111 | ||
| 150 | 112 | @property | |
| 151 | 113 | def connection(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -633,6 +633,7 @@ def test_get_cors_lazy(self): | |||
| 633 | 633 | after = {'cors': [CORS_ENTRY]} | |
| 634 | 634 | connection = _Connection(after) | |
| 635 | 635 | bucket = self._makeOne(connection, NAME) | |
| 636 | + bucket._reload_properties() | ||
| 636 | 637 | entries = bucket.get_cors() | |
| 637 | 638 | self.assertEqual(len(entries), 1) | |
| 638 | 639 | self.assertEqual(entries[0]['maxAgeSeconds'], | |
@@ -725,6 +726,7 @@ def test_get_lifecycle_lazy(self): | |||
| 725 | 726 | after = {'lifecycle': {'rule': [LC_RULE]}} | |
| 726 | 727 | connection = _Connection(after) | |
| 727 | 728 | bucket = self._makeOne(connection, NAME) | |
| 729 | + bucket._reload_properties() | ||
| 728 | 730 | entries = bucket.get_lifecycle() | |
| 729 | 731 | self.assertEqual(len(entries), 1) | |
| 730 | 732 | self.assertEqual(entries[0]['action']['type'], 'Delete') | |
@@ -776,30 +778,22 @@ def test_location_setter(self): | |||
| 776 | 778 | self.assertEqual(kw[0]['data'], {'location': 'AS'}) | |
| 777 | 779 | self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | |
| 778 | 780 | ||
| 779 | - def test_get_logging_eager_w_prefix(self): | ||
| 781 | + def test_get_logging_w_prefix(self): | ||
| 780 | 782 | NAME = 'name' | |
| 781 | 783 | LOG_BUCKET = 'logs' | |
| 782 | 784 | LOG_PREFIX = 'pfx' | |
| 783 | 785 | before = { | |
| 784 | - 'logging': {'logBucket': LOG_BUCKET, | ||
| 785 | - 'logObjectPrefix': LOG_PREFIX}} | ||
| 786 | - connection = _Connection() | ||
| 787 | - bucket = self._makeOne(connection, NAME, before) | ||
| 788 | - info = bucket.get_logging() | ||
| 789 | - self.assertEqual(info['logBucket'], LOG_BUCKET) | ||
| 790 | - self.assertEqual(info['logObjectPrefix'], LOG_PREFIX) | ||
| 791 | - kw = connection._requested | ||
| 792 | - self.assertEqual(len(kw), 0) | ||
| 793 | - | ||
| 794 | - def test_get_logging_lazy_wo_prefix(self): | ||
| 795 | - NAME = 'name' | ||
| 796 | - LOG_BUCKET = 'logs' | ||
| 797 | - after = {'logging': {'logBucket': LOG_BUCKET}} | ||
| 798 | - connection = _Connection(after) | ||
| 786 | + 'logging': { | ||
| 787 | + 'logBucket': LOG_BUCKET, | ||
| 788 | + 'logObjectPrefix': LOG_PREFIX, | ||
| 789 | + }, | ||
| 790 | + } | ||
| 791 | + resp_to_reload = before | ||
| 792 | + connection = _Connection(resp_to_reload) | ||
| 799 | 793 | bucket = self._makeOne(connection, NAME) | |
| 800 | 794 | info = bucket.get_logging() | |
| 801 | 795 | self.assertEqual(info['logBucket'], LOG_BUCKET) | |
| 802 | - self.assertEqual(info.get('logObjectPrefix'), None) | ||
| 796 | + self.assertEqual(info['logObjectPrefix'], LOG_PREFIX) | ||
| 803 | 797 | kw = connection._requested | |
| 804 | 798 | self.assertEqual(len(kw), 1) | |
| 805 | 799 | self.assertEqual(kw[0]['method'], 'GET') | |
@@ -810,57 +804,85 @@ def test_enable_logging_defaults(self): | |||
| 810 | 804 | NAME = 'name' | |
| 811 | 805 | LOG_BUCKET = 'logs' | |
| 812 | 806 | before = {'logging': None} | |
| 813 | - after = {'logging': {'logBucket': LOG_BUCKET, 'logObjectPrefix': ''}} | ||
| 814 | - connection = _Connection(after) | ||
| 807 | + resp_to_reload = before | ||
| 808 | + resp_to_enable_logging = { | ||
| 809 | + 'logging': {'logBucket': LOG_BUCKET, 'logObjectPrefix': ''}, | ||
| 810 | + } | ||
| 811 | + connection = _Connection(resp_to_reload, resp_to_enable_logging, | ||
| 812 | + resp_to_enable_logging) | ||
| 815 | 813 | bucket = self._makeOne(connection, NAME, before) | |
| 816 | 814 | self.assertTrue(bucket.get_logging() is None) | |
| 817 | 815 | bucket.enable_logging(LOG_BUCKET) | |
| 818 | 816 | info = bucket.get_logging() | |
| 819 | 817 | self.assertEqual(info['logBucket'], LOG_BUCKET) | |
| 820 | 818 | self.assertEqual(info['logObjectPrefix'], '') | |
| 821 | 819 | kw = connection._requested | |
| 822 | - self.assertEqual(len(kw), 1) | ||
| 823 | - self.assertEqual(kw[0]['method'], 'PATCH') | ||
| 820 | + self.assertEqual(len(kw), 3) | ||
| 821 | + self.assertEqual(kw[0]['method'], 'GET') | ||
| 824 | 822 | self.assertEqual(kw[0]['path'], '/b/%s' % NAME) | |
| 825 | - self.assertEqual(kw[0]['data'], after) | ||
| 826 | - self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | ||
| 823 | + self.assertEqual(kw[0]['query_params'], {'projection': 'noAcl'}) | ||
| 824 | + self.assertEqual(kw[1]['method'], 'PATCH') | ||
| 825 | + self.assertEqual(kw[1]['path'], '/b/%s' % NAME) | ||
| 826 | + self.assertEqual(kw[1]['data'], resp_to_enable_logging) | ||
| 827 | + self.assertEqual(kw[1]['query_params'], {'projection': 'full'}) | ||
| 828 | + self.assertEqual(kw[2]['method'], 'GET') | ||
| 829 | + self.assertEqual(kw[2]['path'], '/b/%s' % NAME) | ||
| 830 | + self.assertEqual(kw[2]['query_params'], {'projection': 'noAcl'}) | ||
| 827 | 831 | ||
| 828 | 832 | def test_enable_logging_explicit(self): | |
| 829 | 833 | NAME = 'name' | |
| 830 | 834 | LOG_BUCKET = 'logs' | |
| 831 | 835 | LOG_PFX = 'pfx' | |
| 832 | 836 | before = {'logging': None} | |
| 833 | - after = { | ||
| 834 | - 'logging': {'logBucket': LOG_BUCKET, 'logObjectPrefix': LOG_PFX}} | ||
| 835 | - connection = _Connection(after) | ||
| 837 | + resp_to_reload = before | ||
| 838 | + resp_to_enable_logging = { | ||
| 839 | + 'logging': {'logBucket': LOG_BUCKET, 'logObjectPrefix': LOG_PFX}, | ||
| 840 | + } | ||
| 841 | + connection = _Connection(resp_to_reload, | ||
| 842 | + resp_to_enable_logging, | ||
| 843 | + resp_to_enable_logging) | ||
| 836 | 844 | bucket = self._makeOne(connection, NAME, before) | |
| 837 | 845 | self.assertTrue(bucket.get_logging() is None) | |
| 838 | 846 | bucket.enable_logging(LOG_BUCKET, LOG_PFX) | |
| 839 | 847 | info = bucket.get_logging() | |
| 840 | 848 | self.assertEqual(info['logBucket'], LOG_BUCKET) | |
| 841 | 849 | self.assertEqual(info['logObjectPrefix'], LOG_PFX) | |
| 842 | 850 | kw = connection._requested | |
| 843 | - self.assertEqual(len(kw), 1) | ||
| 844 | - self.assertEqual(kw[0]['method'], 'PATCH') | ||
| 851 | + self.assertEqual(len(kw), 3) | ||
| 852 | + self.assertEqual(kw[0]['method'], 'GET') | ||
| 845 | 853 | self.assertEqual(kw[0]['path'], '/b/%s' % NAME) | |
| 846 | - self.assertEqual(kw[0]['data'], after) | ||
| 847 | - self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | ||
| 854 | + self.assertEqual(kw[0]['query_params'], {'projection': 'noAcl'}) | ||
| 855 | + self.assertEqual(kw[1]['method'], 'PATCH') | ||
| 856 | + self.assertEqual(kw[1]['path'], '/b/%s' % NAME) | ||
| 857 | + self.assertEqual(kw[1]['data'], resp_to_enable_logging) | ||
| 858 | + self.assertEqual(kw[1]['query_params'], {'projection': 'full'}) | ||
| 859 | + self.assertEqual(kw[2]['method'], 'GET') | ||
| 860 | + self.assertEqual(kw[2]['path'], '/b/%s' % NAME) | ||
| 861 | + self.assertEqual(kw[2]['query_params'], {'projection': 'noAcl'}) | ||
| 848 | 862 | ||
| 849 | 863 | def test_disable_logging(self): | |
| 850 | 864 | NAME = 'name' | |
| 851 | 865 | before = {'logging': {'logBucket': 'logs', 'logObjectPrefix': 'pfx'}} | |
| 852 | - after = {'logging': None} | ||
| 853 | - connection = _Connection(after) | ||
| 866 | + resp_to_reload = before | ||
| 867 | + resp_to_disable_logging = {'logging': None} | ||
| 868 | + connection = _Connection(resp_to_reload, resp_to_disable_logging, | ||
| 869 | + resp_to_disable_logging) | ||
| 854 | 870 | bucket = self._makeOne(connection, NAME, before) | |
| 855 | 871 | self.assertTrue(bucket.get_logging() is not None) | |
| 856 | 872 | bucket.disable_logging() | |
| 857 | 873 | self.assertTrue(bucket.get_logging() is None) | |
| 858 | 874 | kw = connection._requested | |
| 859 | - self.assertEqual(len(kw), 1) | ||
| 860 | - self.assertEqual(kw[0]['method'], 'PATCH') | ||
| 875 | + self.assertEqual(len(kw), 3) | ||
| 876 | + self.assertEqual(kw[0]['method'], 'GET') | ||
| 861 | 877 | self.assertEqual(kw[0]['path'], '/b/%s' % NAME) | |
| 862 | - self.assertEqual(kw[0]['data'], {'logging': None}) | ||
| 863 | - self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | ||
| 878 | + self.assertEqual(kw[0]['query_params'], {'projection': 'noAcl'}) | ||
| 879 | + self.assertEqual(kw[1]['method'], 'PATCH') | ||
| 880 | + self.assertEqual(kw[1]['path'], '/b/%s' % NAME) | ||
| 881 | + self.assertEqual(kw[1]['data'], {'logging': None}) | ||
| 882 | + self.assertEqual(kw[1]['query_params'], {'projection': 'full'}) | ||
| 883 | + self.assertEqual(kw[2]['method'], 'GET') | ||
| 884 | + self.assertEqual(kw[2]['path'], '/b/%s' % NAME) | ||
| 885 | + self.assertEqual(kw[2]['query_params'], {'projection': 'noAcl'}) | ||
| 864 | 886 | ||
| 865 | 887 | def test_metageneration(self): | |
| 866 | 888 | METAGENERATION = 42 | |
@@ -904,6 +926,7 @@ def test_versioning_enabled_getter_missing(self): | |||
| 904 | 926 | NAME = 'name' | |
| 905 | 927 | connection = _Connection({}) | |
| 906 | 928 | bucket = self._makeOne(connection, NAME) | |
| 929 | + bucket._reload_properties() | ||
| 907 | 930 | self.assertEqual(bucket.versioning_enabled, False) | |
| 908 | 931 | kw = connection._requested | |
| 909 | 932 | self.assertEqual(len(kw), 1) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments