# Path: mysql_autoxtrabackup/utils/helpers.py
# def get_folder_size(path: str) -> Union[str, None]:
# def sorted_ls(path: Optional[str]) -> List[str]:
# def get_directory_size(path: str) -> int:
# def create_backup_directory(directory: str, forced_dir: Optional[str] = None) -> str:
# def get_latest_dir_name(path: Optional[str]) -> Optional[str]:
# def create_directory(path: str) -> Optional[bool]:
# def check_if_backup_prepared(type_: str, path: str) -> str:
# def list_available_backups(path: str) -> Dict[str, List[Dict[str, str]]]:


import os
import shutil
from mysql_autoxtrabackup.utils import helpers



class TestHelpers:
    def test_get_latest_dir_name(self):
        os.makedirs("tests/DELETE_ME", mode=777, exist_ok=True)
        os.makedirs("tests/DELETE_ME/2021-05-06_11-48-31", mode=777, exist_ok=True)
        os.makedirs("tests/DELETE_ME/2021-05-06_11-47-31", mode=777, exist_ok=True)

        assert (

# Path: mysql_autoxtrabackup/utils/helpers.py
# def get_folder_size(path: str) -> Union[str, None]:
# def sorted_ls(path: Optional[str]) -> List[str]:
# def get_directory_size(path: str) -> int:
# def create_backup_directory(directory: str, forced_dir: Optional[str] = None) -> str:
# def get_latest_dir_name(path: Optional[str]) -> Optional[str]:
# def create_directory(path: str) -> Optional[bool]:
# def check_if_backup_prepared(type_: str, path: str) -> str:
# def list_available_backups(path: str) -> Dict[str, List[Dict[str, str]]]:


# Path: tests/test_helpers.py
import os
import shutil
from mysql_autoxtrabackup.utils import helpers




class TestHelpers:
    def test_get_latest_dir_name(self):
        os.makedirs("tests/DELETE_ME", mode=777, exist_ok=True)
        os.makedirs("tests/DELETE_ME/2021-05-06_11-48-31", mode=777, exist_ok=True)
        os.makedirs("tests/DELETE_ME/2021-05-06_11-47-31", mode=777, exist_ok=True)

        assert (

            helpers.get_latest_dir_name(path=f"{os.path.dirname(__file__)}/DELETE_ME")