Skip to content

Commit

Permalink
Unique share names
Browse files Browse the repository at this point in the history
  • Loading branch information
annatisch committed Oct 24, 2019
1 parent 8c73dec commit 5702cb1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def tearDown(self):
async def _test_create_directory(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "dirshare")
share = ShareClient.from_connection_string(self.connection_string, "dirshare-a")

# Create the share
await share.create_share()
Expand Down Expand Up @@ -88,7 +88,7 @@ def test_create_directory(self):
async def _test_create_subdirectories(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "subdirshare")
share = ShareClient.from_connection_string(self.connection_string, "subdirshare-a")

# Create the share
await share.create_share()
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_create_subdirectories(self):
async def _test_get_subdirectory_client(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "dirtest")
share = ShareClient.from_connection_string(self.connection_string, "dirtest-a")

# Create the share
await share.create_share()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def tearDown(self):
async def _test_file_operations(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "filesshare")
share = ShareClient.from_connection_string(self.connection_string, "filesshare-a")

# Create the share
await share.create_share()
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_file_operations(self):
async def _test_copy_from_url(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "filesfromurl")
share = ShareClient.from_connection_string(self.connection_string, "filesfromurl-a")

# Create the share
await share.create_share()
Expand All @@ -118,7 +118,7 @@ async def _test_copy_from_url(self):
source_url = "{}://{}.file.core.windows.net/{}/{}".format(
settings.PROTOCOL,
settings.STORAGE_ACCOUNT_NAME,
"filesfromurl",
"filesfromurl-a",
"sourcefile"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_create_client_with_connection_string(self):
async def _test_create_file_share(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, share_name="myshare")
share = ShareClient.from_connection_string(self.connection_string, share_name="myshare-a")

# Create the share
await share.create_share()
Expand All @@ -86,7 +86,7 @@ def test_create_file_share(self):
async def _test_upload_file_to_share(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, share_name='share')
share = ShareClient.from_connection_string(self.connection_string, share_name='share-a')

# Create the share
await share.create_share()
Expand All @@ -95,7 +95,7 @@ async def _test_upload_file_to_share(self):
# Instantiate the ShareFileClient from a connection string
# [START create_file_client]
from azure.storage.fileshare.aio import ShareFileClient
file = ShareFileClient.from_connection_string(self.connection_string, share_name='share', file_path="myfile")
file = ShareFileClient.from_connection_string(self.connection_string, share_name='share-a', file_path="myfile")
# [END create_file_client]

# Upload a file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def _test_share_operations(self):
file_service = ShareServiceClient.from_connection_string(self.connection_string)

# [START fsc_create_shares]
await file_service.create_share(share_name="testshare")
await file_service.create_share(share_name="testshare-a")
# [END fsc_create_shares]
try:
# [START fsc_list_shares]
Expand All @@ -89,7 +89,7 @@ async def _test_share_operations(self):

finally:
# [START fsc_delete_shares]
await file_service.delete_share(share_name="testshare")
await file_service.delete_share(share_name="testshare-a")
# [END fsc_delete_shares]

def test_share_operations(self):
Expand All @@ -104,7 +104,7 @@ async def _test_get_share_client(self):
file_service = ShareServiceClient.from_connection_string(self.connection_string)

# Get a share client to interact with a specific share
share = file_service.get_share_client("fileshare")
share = file_service.get_share_client("fileshare-a")
# [END get_share_client]

def test_get_share_client(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_create_share_snapshot(self):
def test_set_share_quota_and_metadata(self):
# [START create_share_client_from_conn_string]
from azure.storage.fileshare import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "fileshare")
share = ShareClient.from_connection_string(self.connection_string, "metafileshare")
# [END create_share_client_from_conn_string]

# Create the share
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def tearDown(self):
async def _test_create_share_snapshot(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "sharesnapshot")
share = ShareClient.from_connection_string(self.connection_string, "sharesnapshot-a")

# [START create_share]
await share.create_share()
Expand All @@ -73,7 +73,7 @@ def test_create_share_snapshot(self):
async def _test_set_share_quota_and_metadata(self):
# [START create_share_client_from_conn_string]
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "fileshare")
share = ShareClient.from_connection_string(self.connection_string, "metafileshare-a")
# [END create_share_client_from_conn_string]

# Create the share
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_set_share_quota_and_metadata(self):
async def _test_list_directories_and_files(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "listshare")
share = ShareClient.from_connection_string(self.connection_string, "listshare-a")

# Create the share
await share.create_share()
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_list_directories_and_files(self):
async def _test_get_directory_or_file_client(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "testfiles")
share = ShareClient.from_connection_string(self.connection_string, "testfile-a")

# Get the directory client to interact with a specific directory
my_dir = share.get_directory_client("dir1")
Expand Down

0 comments on commit 5702cb1

Please sign in to comment.