Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get FileNotFoundError when use relative path as file_body #637

Open
cyj5230 opened this issue Jan 28, 2021 · 1 comment
Open

Get FileNotFoundError when use relative path as file_body #637

cyj5230 opened this issue Jan 28, 2021 · 1 comment

Comments

@cyj5230
Copy link

cyj5230 commented Jan 28, 2021

I put all my test data into 1 folder, say /mnt/c/users/me/documents/repo/test/tavern/latest/test_data
while the test yaml is in /mnt/c/users/me/documents/repo/test/tavern/latest/folder/test.yaml

json: !include ../test_data/file.yaml -> this works
file_body: ../test_data/file.bin -> this doesn't work, get FileNotFoundError
file_body: {full_path}/file.bin -> this works
file_body: test/tavern/latest/test_data/file.bin -> this works

Is it possible to unify the relative path logic, so that I can use similar file path for !include and file_body? Thank you.

@michaelboulton
Copy link
Member

This isn't impossible but it is a bit fiddly because loading files with !include is handled using the TAVERN_INCLUDE_PATH and the path of the file the include is actually in, but loading files to send in a request is handled by requests so it works relative to the directory the tests are run in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants