def test_generator_local_git_repo_root_directory():
    """Generator for tests requiring operation in a git repository.

    This will move into a temporary directory which is a git repository. It
    will then return the tests with the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    st.vcs_git.init_repo(".")

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             git_root_dir_settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 2
0
def test_generator_parsing_errors_expected():
    """Generator for tests relating to name verification.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             settings_list):
        yield test

    # checks that no module folders have been created
    assert_false(os.listdir("."))

    os.chdir(cwd)

    shutil.rmtree(tempdir)
def test_generator_conflicting_filepaths_expected():
    """Generator for tests involving a conflict of filepaths.

    This will move into a temporary directory which already has a number of
    folders that will conflict with the file creation process. It
    will then return the tests with the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    for settings in folder_conflict_settings_list:
        os.makedirs(settings.pop('create_folder'))

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             folder_conflict_settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 4
0
def test_generator_conflicting_filepaths_expected():
    """Generator for tests involving a conflict of filepaths.

    This will move into a temporary directory which already has a number of
    folders that will conflict with the file creation process. It
    will then return the tests with the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    for settings in folder_conflict_settings_list:
        os.makedirs(settings.pop('create_folder'))

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             folder_conflict_settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 5
0
def test_generator_export_to_server():
    """Generator for tests relating to remote server repository creation.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    alter_settings_dictionaries(settings_list)

    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    # Unpack tar in tempdir and change to match currently logged in user.
    snm_util.untar_comparison_files_and_insert_user_login(
            COMPARISON_FILES + ".tar.gz", tempdir
    )

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py",
                                             settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
def test_generator_parsing_errors_expected():
    """Generator for tests relating to name verification.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             settings_list):
        yield test

    # checks that no module folders have been created
    assert_false(os.listdir("."))

    os.chdir(cwd)

    shutil.rmtree(tempdir)
def test_generator_export_to_server():
    """Generator for tests relating to remote server repository creation.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    alter_settings_dictionaries(settings_list)

    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    # Unpack tar in tempdir and change to match currently logged in user.
    snm_util.untar_comparison_files_and_insert_user_login(
            COMPARISON_FILES + ".tar.gz", tempdir
    )

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py",
                                             settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 8
0
def test_generator_local_git_repo_root_directory():
    """Generator for tests requiring operation in a git repository.

    This will move into a temporary directory which is a git repository. It
    will then return the tests with the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    st.vcs_git.init_repo(".")

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             git_root_dir_settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
def test_generator():

    cwd = os.getcwd()
    os.chdir(sys_test_dir_path)

    for test in st.generate_tests_from_dicts("dls-module-contacts.py", settings_list):

        yield test

    os.chdir(cwd)
Exemplo n.º 10
0
def test_generator():

    cwd = os.getcwd()
    os.chdir(sys_test_dir_path)

    for test in st.generate_tests_from_dicts("dls-module-contacts.py",
                                             settings_list):

        yield test

    os.chdir(cwd)
Exemplo n.º 11
0
def test_generator():

    for test in st.generate_tests_from_dicts("dls-checkout-module.py",
                                             settings_list):

        tempdir = tempfile.mkdtemp()
        cwd = os.getcwd()
        os.chdir(tempdir)

        yield test

        os.chdir(cwd)
        shutil.rmtree(tempdir)
def test_generator():

    for test in st.generate_tests_from_dicts("dls-checkout-module.py",
                                             settings_list):

        tempdir = tempfile.mkdtemp()
        cwd = os.getcwd()
        os.chdir(tempdir)

        yield test

        os.chdir(cwd)
        shutil.rmtree(tempdir)
Exemplo n.º 13
0
def test_generator():
    """A system test generator used as an example.

    When called by nosetests, nosetests will run every yielded test function.

    Note:
        Make sure you unpack the `test_repos.tar.gz` tarball to obtain all the
        repositories needed.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    for test in st.generate_tests_from_dicts("./test_error_script.py", settings_list):
        yield test
Exemplo n.º 14
0
def test_generator():
    """A system test generator used as an example.

    When called by nosetests, nosetests will run every yielded test function.

    Note:
        Make sure you unpack the `test_repos.tar.gz` tarball to obtain all the
        repositories needed.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    for test in st.generate_tests_from_dicts("./test_error_script.py",
                                             settings_list):
        yield test
Exemplo n.º 15
0
def test_generator_local():
    """Generator for tests relating to local repository creation.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    # Search the COMPARISON_FILES folder for folders to compare with.
    for settings_dict in settings_list:
        # Path used by multiple fields; only input one to avoid duplication.
        path = settings_dict['path']

        settings_dict['local_repo_path'] = path
        settings_dict['local_comp_path_one'] = path

        # Search the COMPARISON_FILES folder for folders to compare with.
        settings_dict['local_comp_path_two'] = os.path.join(
                COMPARISON_FILES,
                path
        )

    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    # Unpack tar in tempdir and change to match currently logged in user.
    snm_util.untar_comparison_files_and_insert_user_login(
            COMPARISON_FILES + ".tar.gz", tempdir
    )

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 16
0
def test_generator_export_add_app_to_server():
    """Generator for tests where an app is added to a pre-existing repository.

    This will move into a temporary directory to run the tests with the given
    script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    for settings_dict in add_app_settings_list:
        # Set the server repository to the default to start with.

        settings_dict['default_server_repo_path'] = os.path.join(
                ORIGINAL_GIT_ROOT_DIR,
                settings_dict['module_area'],
                settings_dict['path'],
        )

    alter_settings_dictionaries(add_app_settings_list)

    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    # Unpack tar in tempdir and change to match currently logged in user.
    snm_util.untar_comparison_files_and_insert_user_login(
            COMPARISON_FILES + ".tar.gz", tempdir
    )

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py",
                                             add_app_settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 17
0
def test_generator_export_add_app_to_server():
    """Generator for tests where an app is added to a pre-existing repository.

    This will move into a temporary directory to run the tests with the given
    script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    for settings_dict in add_app_settings_list:
        # Set the server repository to the default to start with.

        settings_dict['default_server_repo_path'] = os.path.join(
                ORIGINAL_GIT_ROOT_DIR,
                settings_dict['module_area'],
                settings_dict['path'],
        )

    alter_settings_dictionaries(add_app_settings_list)

    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    # Unpack tar in tempdir and change to match currently logged in user.
    snm_util.untar_comparison_files_and_insert_user_login(
            COMPARISON_FILES + ".tar.gz", tempdir
    )

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py",
                                             add_app_settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 18
0
def test_generator_local():
    """Generator for tests relating to local repository creation.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    # Search the COMPARISON_FILES folder for folders to compare with.
    for settings_dict in settings_list:
        # Path used by multiple fields; only input one to avoid duplication.
        path = settings_dict['path']

        settings_dict['local_repo_path'] = path
        settings_dict['local_comp_path_one'] = path

        # Search the COMPARISON_FILES folder for folders to compare with.
        settings_dict['local_comp_path_two'] = path

    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    # Unpack tar in tempdir and change to match currently logged in user.
    snm_util.untar_comparison_files_and_insert_user_login(
        COMPARISON_FILES + ".tar.gz", tempdir)

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py -n",
                                             settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 19
0
def test_generator_remote_verification():
    """Generator for tests relating to remote server verification.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py",
                                             settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
def test_generator_remote_verification():
    """Generator for tests relating to remote server verification.

    This will move into a temporary directory before returning the tests with
    the given script and settings list.

    When called by nosetests, nosetests will run every yielded test function.

    Yields:
        A :class:`system_testing.SystemTest` instance.

    """
    tempdir = tempfile.mkdtemp()
    cwd = os.getcwd()

    os.chdir(tempdir)

    for test in st.generate_tests_from_dicts("dls-start-new-module.py",
                                             settings_list):
        yield test

    os.chdir(cwd)

    shutil.rmtree(tempdir)
Exemplo n.º 21
0
def test_generator():

    for test in st.generate_tests_from_dicts("dls-tar-module.py",
                                             settings_list):
        yield test
Exemplo n.º 22
0
def test_generator():

    for test in st.generate_tests_from_dicts("dls-logs-since-release.py",
                                             settings_list):
        yield test
def test_generator():

    for test in st.generate_tests_from_dicts("dls-changes-since-release.py",
                                             settings_list):
        yield test
Exemplo n.º 24
0
def test_generator():

    for test in st.generate_tests_from_dicts("dls-list-branches.py",
                                             settings_list):
        yield test
Exemplo n.º 25
0
def test_generator():

    for test in st.generate_tests_from_dicts("dls-list-modules.py",
                                             settings_list):
        yield test