コード例 #1
0
def test_update_travis_4_pages():
    path_old, path_expected = _prepare_old_file("travis_3", ".yml")

    args = ['--travisfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #2
0
def test_update_travis_installer_only_import_to_fixed_hash():
    path_old, path_expected = _prepare_old_file("travis_5", ".yml")

    args = ['--travisfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
def test_update_clang_filter_branch():
    """ Clone dummy project, filter by branch and update it.
    """
    args = [
        '--remote', 'uilianries/conan-base64', '--dry-run', '--branch-pattern',
        'testing/*'
    ]
    command = Command()
    command.run(args)
def test_travis_update_url():
    """ Create a README.md file and update it.
    """

    path_old, path_expected = _prepare_old_file("readme_1", ".md")

    args = ['--readme', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #5
0
def test_appveyor_update():
    """ Try to update an AppVeyor file
    """

    path_old, path_expected = _prepare_old_file("appveyor_1", ".yml")

    args = ['--appveyorfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #6
0
def test_conanfile_2():
    """ Try to update an conanfile which old Conan recipe references
    """

    path_old, path_expected = _prepare_old_file("conan_2", ".py")

    args = ['--conanfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #7
0
def test_update_travis_file():
    """ Create a standard travis file and update it.
    """

    path_old, path_expected = _prepare_old_file("travis_1", ".yml")

    args = ['--travisfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #8
0
def test_conanfile_default_options():
    """ Try to update an conanfile which has old styled default options
    """

    path_old, path_expected = _prepare_old_file("conan_1", ".py")

    args = ['--conanfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #9
0
def test_gha():
    """ Try to update an GitHub actions file
    """

    path_old, path_expected = _prepare_old_file("gha_1", ".yml")

    args = ['--ghafile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #10
0
def test_appveyor_update_new_compiler_jobs():
    """ Try to update an AppVeyor file, new compiler jobs should be added
    """

    path_old, path_expected = _prepare_old_file("appveyor_2", ".yml")

    args = ['--appveyorfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #11
0
def test_appveyor_3_32bit_builds_update():
    """ Update AppVeyor config file with 32bit builds, which should get removed
    """

    path_old, path_expected = _prepare_old_file("appveyor_3_32bit_builds",
                                                ".yml")

    args = ['--appveyorfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #12
0
def test_updated_conanfile():
    """ Try to update an already up-to-date file, nothing should change
    """

    path_old, path_expected = _prepare_old_file("conan_1",
                                                ".py",
                                                old="conan_1_expected")

    args = ['--conanfile', path_old]
    command = Command()
    command.run(args)

    assert _compare_file(path_old, path_expected)
コード例 #13
0
def test_updated_conanfile():
    """ Try to update an already up-to-date file, nothing should change
    """
    _, conan_path = tempfile.mkstemp(prefix='conanfile', suffix='.py')
    with open(conan_path, 'w') as file:
        file.write(EXPECTED_CONAN_FILE)

    _, expected_path = tempfile.mkstemp(prefix='conanfile', suffix='.py')
    with open(expected_path, 'w') as file:
        file.write(EXPECTED_CONAN_FILE)

    args = ['--conanfile', conan_path]
    command = Command()
    command.run(args)

    assert filecmp.cmp(conan_path, expected_path)
コード例 #14
0
def test_conanfile_default_options():
    """ Try to update an up-to-date file
    """
    _, conan_path = tempfile.mkstemp(prefix='conanfile', suffix='.py')
    with open(conan_path, 'w') as file:
        file.write(CONAN_FILE_OLD)

    _, expected_path = tempfile.mkstemp(prefix='conanfile', suffix='.py')
    with open(expected_path, 'w') as file:
        file.write(EXPECTED_CONAN_FILE)

    args = ['--conanfile', conan_path]
    command = Command()
    command.run(args)

    assert filecmp.cmp(conan_path, expected_path)
コード例 #15
0
def test_conanfile_default_options_mutiline():
    """ Try to update an conanfile which has old styled multiline default options
    """
    _, conan_path = tempfile.mkstemp(prefix='conanfile', suffix='.py')
    with open(conan_path, 'w') as file:
        file.write(CONAN_FILE_OLD_MULTILINE)

    _, expected_path = tempfile.mkstemp(prefix='conanfile', suffix='.py')
    with open(expected_path, 'w') as file:
        file.write(EXPECTED_CONAN_FILE)

    args = ['--conanfile', conan_path]
    command = Command()
    command.run(args)

    assert filecmp.cmp(conan_path, expected_path)
コード例 #16
0
def test_update_travis_file_with_global():
    """ Create a standard travis file and update it.
    """
    _, travis_path = tempfile.mkstemp(prefix='travis', suffix='.yml')
    with open(travis_path, 'w') as file:
        file.write(TRAVIS_FILE_WITH_GLOBAL)

    _, expected_path = tempfile.mkstemp(prefix='travis', suffix='.yml')
    with open(expected_path, 'w') as file:
        file.write(EXPECTED_TRAVIS_FILE_WITH_GLOBAL)

    args = ['--travisfile', travis_path]
    command = Command()
    command.run(args)

    assert filecmp.cmp(travis_path, expected_path)
コード例 #17
0
def test_appveyor_update():
    """ Try to update an up-to-date file
    """
    _, appveyor_path = tempfile.mkstemp(prefix='appveyor', suffix='.yml')
    with open(appveyor_path, 'w') as file:
        file.write(APPVEYOR_FILE)

    _, expected_path = tempfile.mkstemp(prefix='appveyor', suffix='.yml')
    with open(expected_path, 'w') as file:
        file.write(EXPECTED_APPVEYOR_FILE)

    args = ['--appveyorfile', appveyor_path]
    command = Command()
    command.run(args)

    assert filecmp.cmp(appveyor_path, expected_path)
コード例 #18
0
 def file_contains(self, file, word):
     command = Command()
     return command.file_contains(file, word)
コード例 #19
0
def test_const_dry_run():
    """ Clone dummy project, filter by branch and update it.
    """
    args = ["--remote=bincrafters/conan-libmodplug", "--dry-run"]
    command = Command()
    result = command.run(args)
def test_update_clang_remote_project():
    """ Clone dummy project and update it.
    """
    args = ['--remote', 'uilianries/conan-base64', '--dry-run']
    command = Command()
    command.run(args)