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

Issue/missing files error #829

Merged
merged 2 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/inmanta/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def get_file_internal(self, file_hash):
file_name = os.path.join(self._server_storage["files"], file_hash)

if not os.path.exists(file_name):
return 404
return 404, None

else:
with open(file_name, "rb") as fd:
Expand Down
9 changes: 9 additions & 0 deletions tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ def test_client_files(client):
assert result.result["content"] == body


@pytest.mark.gen_test
def test_client_files_lost(client):
(hash, content, body) = make_random_file()

# Get the file
result = yield client.get_file(id=hash)
assert result.code == 404


@pytest.mark.gen_test
def test_sync_client_files(client):
done = []
Expand Down