Add new alternates processing the cygwin copy testing

This commit is contained in:
Tim Byrne 2019-09-29 17:48:20 -05:00
parent eeba216cfe
commit 36212cb752
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
2 changed files with 11 additions and 4 deletions

View File

@ -459,6 +459,8 @@ def ds1_dset(tst_sys, cygwin_sys):
dset.add_file(f'test alt/test alt##C.S.H.U')
dset.add_file(f'test_cygwin_copy##{tst_sys}')
dset.add_file(f'test_cygwin_copy##{cygwin_sys}')
dset.add_file(f'test_cygwin_copy##os.{tst_sys}')
dset.add_file(f'test_cygwin_copy##os.{cygwin_sys}')
dset.add_file('u1', tracked=False)
dset.add_file('d2/u2', tracked=False)
dset.add_file('.ssh/p1', tracked=False, private=True)

View File

@ -37,7 +37,11 @@ def test_cygwin_copy(
if setting is not None:
os.system(' '.join(yadm_y('config', 'yadm.cygwin-copy', str(setting))))
expected_content = f'test_cygwin_copy##{tst_sys}'
if compatibility:
expected_content = f'test_cygwin_copy##{tst_sys}'
else:
expected_content = f'test_cygwin_copy##os.{tst_sys}'
alt_path = paths.work.join('test_cygwin_copy')
if pre_existing == 'symlink':
alt_path.mklinkto(expected_content)
@ -49,13 +53,14 @@ def test_cygwin_copy(
uname = uname_path.join('uname')
uname.write(f'#!/bin/sh\necho "{cygwin_sys}"\n')
uname.chmod(0o777)
expected_content = f'test_cygwin_copy##{cygwin_sys}'
if compatibility:
expected_content = f'test_cygwin_copy##{cygwin_sys}'
else:
expected_content = f'test_cygwin_copy##os.{cygwin_sys}'
env = os.environ.copy()
env['PATH'] = ':'.join([str(uname_path), env['PATH']])
if compatibility:
env['YADM_COMPATIBILITY'] = '1'
else:
pytest.xfail('Alternates 2.0.0 has not been implemented.')
run = runner(yadm_y('alt'), env=env)
assert run.success