utils/file-tester/lms_file_tester/validators/directory_validation.py
def validate_system_activities_directory_structure(input_directory: str) -> List[str]:
    """
    Validates that a System Activities directory exists and contains at least
    one sub-directory with a properly-formated name.

    Parameters
    ----------
    input_directory: str
        Base / parent directory containing files created by an LMS extractor.

    Returns
    -------
    List[str]
        List containing detailed error messages, if any.
    """
    dir = dr.get_system_activities_directory(input_directory)
    is_missing = _check_for_directory(dir)
    if is_missing:
        return [is_missing]

    # Get all directories. Ignore random directories, but ensure that there is
    # at least one proper directory with the expected naming convention.
    sub_directories = os.listdir(dir)

    pattern = re.compile(r"^date=\d\d\d\d-\d\d-\d\d$")
    if not any(d for d in sub_directories if pattern.match(d) is not None):
        return ["System activities directory does not contain any date-based sub-directories"]

    return list()

    Validates that a System Activities directory exists and contains at least
    one sub-directory with a properly-formated name.

    Parameters
    ----------
    input_directory: str
        Base / parent directory containing files created by an LMS extractor.

    Returns
    -------
    List[str]
        List containing detailed error messages, if any.
    
Validates that a System Activities directory exists and contains at least
one sub-directory with a properly-formated name.

Parameters

str
Base / parent directory containing files created by an LMS extractor.

Returns

List[str]
List containing detailed error messages, if any.
Validates that a System Activities directory exists and contains at least one sub - directory with a properly - formated name . Parameters str Base / parent directory containing files created by an LMS extractor . Returns List [ str ] List containing detailed error messages if any .
def validate_system_activities_directory_structure(input_directory: str) -> List[str]:
    dir = dr.get_system_activities_directory(input_directory)
    is_missing = _check_for_directory(dir)
    if is_missing:
        return [is_missing]
    sub_directories = os.listdir(dir)
    pattern = re.compile(r"^date=\d\d\d\d-\d\d-\d\d$")
    if not any(d for d in sub_directories if pattern.match(d) is not None):
        return ["System activities directory does not contain any date-based sub-directories"]
    return list()
def validate_system_activities_directory_structure ( input_directory : str ) -> List [ str ] : dir = dr . get_system_activities_directory ( input_directory ) is_missing = _check_for_directory ( dir ) if is_missing : return [ is_missing ] sub_directories = os . listdir ( dir ) pattern = re . compile ( r"^date=\d\d\d\d-\d\d-\d\d$" ) if not any ( d for d in sub_directories if pattern . match ( d ) is not None ) : return [ "System activities directory does not contain any date-based sub-directories" ] return list ( )
Validates that a System Activities directory exists and contains at least
one sub-directory with a properly-formated name.
Validates that a System Activities directory exists and contains at least one sub - directory with a properly - formated name .
"""
    Validates that a System Activities directory exists and contains at least
    one sub-directory with a properly-formated name.

    Parameters
    ----------
    input_directory: str
        Base / parent directory containing files created by an LMS extractor.

    Returns
    -------
    List[str]
        List containing detailed error messages, if any.
    """ # Get all directories. Ignore random directories, but ensure that there is # at least one proper directory with the expected naming convention.
input_directory
str