Esempio n. 1
0
def test_build_with_none_processing_returns_the_os_walk_result(basic_structure):
    base_dir = str(basic_structure)
    expected = [(0, base_dir,['ideskeleton', 'tests'],['.gitignore', '.travis.yml', 'LICENSE', 'README.md', 'requirements.txt']),
                (1, os.path.join(base_dir,"ideskeleton"), [], ['builder.py', '__init__.py', '__main__.py']),
                (1, os.path.join(base_dir,"tests"), ['data'], ['test_builder.py', '__init__.py']),
                (2, os.path.join(base_dir,"tests","data"),[],['ideskeleton_pyproj.xml', 'ideskeleton_sln.txt', 'tests_pyproj.xml'])]


    actual = builder.build(base_dir)

    assert actual == expected
def solution_builder(tmpdir_factory):
    basic = tmpdir_factory.mktemp("solution_builder")
    git_file = basic.join(".gitignore")

    git_file.write_text(u".git/\n" + "#this is a comment\n" + "\n" + "*.sln\n" + "[Dd]ebug/\n", "ascii")
    basic.join(".travis.yml").write("")
    basic.join("LICENSE").write("")
    basic.join("README.md").write("")
    basic.join("requirements.txt").write("")
    ideskeleton = basic.mkdir("ideskeleton")
    test = basic.mkdir("tests")
    data = test.mkdir("data")
    ideskeleton.join("builder.py").write("")
    ideskeleton.join("__init__.py").write("")
    ideskeleton.join("__main__.py").write("")
    test.join("test_builder.py").write("")
    test.join("__init__.py").write("")
    data.join("ideskeleton_pyproj.xml").write("")
    data.join("ideskeleton_sln.txt").write("")
    data.join("tests_pyproj.xml").write("")

    builder.build(str(basic), ide="vstudio")

    return basic
Esempio n. 3
0
def test_build_if_gitignore_not_found_error(tmpdir):
    with pytest.raises(IOError):
        builder.build(tmpdir.dirname)
Esempio n. 4
0
def test_build_if_source_path_does_not_exist_error(tmpdir):
    not_existing = os.path.join(tmpdir.dirname, "not_existing")
    with pytest.raises(IOError):
        builder.build(not_existing)