Retry count on API calls (if None, use the collection default)
"""
+ if storage_classes and type(storage_classes) is not list:
+ raise errors.ArgumentError("storage_classes must be list type.")
if not self.committed():
if not self._has_collection_uuid():
text = self.manifest_text(strip=False)
body={'manifest_text': text}
if storage_classes:
- if type(storage_classes) is not list:
- raise errors.ArgumentError("storage_classes must be list type.")
body["storage_classes_desired"] = storage_classes
self._remember_api_response(self._my_api().collections().update(
self._portable_data_hash = self._api_response["portable_data_hash"]
self.set_committed(True)
elif storage_classes:
- if type(storage_classes) is not list:
- raise errors.ArgumentError("storage_classes must be list type.")
self._remember_api_response(self._my_api().collections().update(
uuid=self._manifest_locator,
body={"storage_classes_desired": storage_classes}
r"^\. 781e5e245d69b566979b86e28d23f2c7\+10\+A[a-f0-9]{40}@[a-f0-9]{8} 0:10:count\.txt$",)
self.assertEqual(c.api_response()["storage_classes_desired"], ['archive'])
+ def test_update_storage_classes_desired_if_collection_is_commited(self):
+ c = self.create_count_txt()
+ c.save(storage_classes=['hot'])
+ c.save(storage_classes=['cold'])
+
+ self.assertEqual(c.api_response()["storage_classes_desired"], ['cold'])
+
def test_create_diff_apply(self):
c1 = self.create_count_txt()
c1.save()