Esempio n. 1
0
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'
Esempio n. 2
0
def test_postlink():
    assert not os.path.exists(expand_path('./dist/3.txt'))
Esempio n. 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'))
Esempio n. 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'
Esempio n. 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'
Esempio n. 6
0
def test_linking():
    assert os.path.islink(expand_path('./other_dist/2.txt'))
Esempio n. 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'))
Esempio n. 8
0
def test_no_prelink():
    assert not os.path.exists(expand_path('./dist/1.txt'))