Exemple #1
0
def _find_core_nlu_files_in_directory(
        directory: Text,
        skill_imports: SkillSelector) -> Tuple[Set[Text], Set[Text]]:
    story_files = set()
    nlu_data_files = set()

    for root, _, files in os.walk(directory):
        if not skill_imports.is_imported(root):
            continue

        for f in files:
            full_path = os.path.join(root, f)

            if not _is_valid_filetype(full_path):
                continue

            if _is_nlu_file(full_path):
                nlu_data_files.add(full_path)
            elif _is_story_file(full_path):
                story_files.add(full_path)

    return story_files, nlu_data_files
Exemple #2
0
def test_not_in_imports(input_path):
    importer = SkillSelector({"A/A/A", "A/B/A"})

    assert not importer.is_imported(input_path)