Skip to content

Commit

Permalink
Issue/missing files error (#829)
Browse files Browse the repository at this point in the history
* added fix for missing files bug
  • Loading branch information
wouterdb authored and bartv committed Dec 7, 2018
1 parent 191ddd7 commit 9f7f237
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 9f7f237

Please sign in to comment.