12345678910111213141516 |
- def prepare_share(cls, share_name: str, azure_fileshare_conn_id: str, file_name: str, directory: str):
- """
- Create share with a file in given directory. If directory is None, file is in root dir.
- """
- cls.create_share(share_name=share_name, azure_fileshare_conn_id=azure_fileshare_conn_id)
- cls.create_directory(
- share_name=share_name, azure_fileshare_conn_id=azure_fileshare_conn_id, directory=directory
- )
- string_data = "".join(random.choice(string.ascii_letters) for _ in range(1024))
- cls.upload_file_from_string(
- string_data=string_data,
- share_name=share_name,
- azure_fileshare_conn_id=azure_fileshare_conn_id,
- file_name=file_name,
- directory=directory,
- )
|