/opt/imh-python/lib/python3.9/site-packages/libcloud/test/storage
NameSizeModeActions
fixtures/-0755rm
__pycache__/-0755rm
base.py15640644editdlrm
test_atmos.py321220644editdlrm
test_aurora.py16840644editdlrm
test_azure_blobs.py376700644editdlrm
test_backblaze_b2.py106350644editdlrm
test_base.py110450644editdlrm
test_cloudfiles.py565820644editdlrm
test_digitalocean_spaces.py53240644editdlrm
test_dummy.py20550644editdlrm
test_google_storage.py215900644editdlrm
test_local.py209620644editdlrm
test_ninefold.py13670644editdlrm
test_oss.py317150644editdlrm
test_rgw.py37340644editdlrm
test_s3.py495180644editdlrm
__init__.py00644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/libcloud/test/storage/test_dummy.py (2055B)
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import pytest from libcloud.storage.drivers.dummy import DummyStorageDriver @pytest.fixture def driver(): return DummyStorageDriver('key', 'id') @pytest.fixture def container_with_contents(driver): container_name = 'test' object_name = 'test.dat' container = driver.create_container(container_name=container_name) driver.upload_object( __file__, container=container, object_name=object_name ) return container_name, object_name def test_list_container_objects(driver, container_with_contents): container_name, object_name = container_with_contents container = driver.get_container(container_name) objects = driver.list_container_objects(container=container) assert any(o for o in objects if o.name == object_name) def test_list_container_objects_filter_by_prefix( driver, container_with_contents ): container_name, object_name = container_with_contents container = driver.get_container(container_name) objects = driver.list_container_objects( container=container, prefix=object_name[:3] ) assert any(o for o in objects if o.name == object_name) objects = driver.list_container_objects( container=container, prefix='does-not-exist.dat' ) assert not objects