def test_no_overwrite():
    with io.open(expand_path('./dist/1.txt')) as fin:
        assert fin.read().strip() == 'original 1'
    with io.open(expand_path('./dist/2.txt')) as fin:
        assert fin.read().strip() == 'original 2'
Beispiel #2
0
def test_postlink():
    assert not os.path.exists(expand_path('./dist/3.txt'))
Beispiel #3
0
def test_clean():
    assert not os.path.exists(expand_path('./dist/broken1.txt'))
    assert not os.path.islink(expand_path('./dist/broken1.txt'))
    assert not os.path.exists(expand_path('./dist/broken2.txt'))
    assert not os.path.islink(expand_path('./dist/broken2.txt'))
Beispiel #4
0
def test_prelink():
    assert os.path.isfile(expand_path('./dist/1.txt'))
    with io.open(expand_path('./dist/2.txt')) as fin:
        assert fin.read().strip() == '200'
Beispiel #5
0
def test_overwrite():
    assert os.path.isfile(expand_path('./dist/1.txt'))
    with io.open(expand_path('./dist/1.txt')) as fin:
        assert fin.read().strip() == '1'
Beispiel #6
0
def test_linking():
    assert os.path.islink(expand_path('./other_dist/2.txt'))
Beispiel #7
0
def test_prompt_n():
    with mock.patch.object(builtins, 'input', return_value='n'):
        with config():
            assert not os.path.exists(expand_path('./dist1/test1'))
            assert not os.path.exists(expand_path('./dist2/test2'))
def test_no_prelink():
    assert not os.path.exists(expand_path('./dist/1.txt'))