rnp
rnp copied to clipboard
Non-portable paths in rnp client tests (Python)
Current state and the issue
gpg built for Msys environment 'understands' MSys paths only, i.e.: '''C:\Program Files\PostgreSQL\12''' shall be ```/c/Program Files/PostgreSQL/12/'''
gpg build for Windows environment works with true Windows paths only, i.e.: C:/Program Files/PostgreSQL/12/''' shall be C:\Program Files\PostgreSQL\12''' (most of Windows programs allow to mix forward and back slashes, but not gpg)
rnp client tests (Python) include multiple definitions like
ret, _, _ = run_proc(RNPK, ['--import', data_path('test_key_edge_cases/key-eddsa-small-x-pub.asc')])
that create Unix-style paths' fragments on Windows that
- forces to use MSys environment even for native Windows tests
- makes it practically impossible to use debugger in Windows environment
Proposed fix
ret, _, _ = run_proc(RNPK, ['--import', data_path('test_key_edge_cases/key-eddsa-small-x-pub.asc')])
shall be
ret, _, _ = run_proc(RNPK, ['--import', data_path(os.path.join('test_key_edge_cases', 'key-eddsa-small-x-pub.asc')])
(~50 locations)