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