Skip to content

Commit

Permalink
fix: use correct types for generation (#521)
Browse files Browse the repository at this point in the history
Generation as passed in here is a string, leading to weird
failures in some cases.
  • Loading branch information
tritone authored Aug 3, 2023
1 parent c0f6841 commit bbc3fd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testbench/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def _get_object(

live_generation = self._live_generations[bucket_key].get(object_name, None)

if generation is None or generation == 0:
if generation is None or int(generation) == 0:
# We are looking for the latest "live" version, but there is none.
if live_generation is None:
return testbench.error.notfound(
Expand All @@ -266,7 +266,7 @@ def _get_object(
if blob is None:
return testbench.error.notfound(
"Could not find object %s/%s#%d"
% (bucket_name, object_name, generation),
% (bucket_name, object_name, lookup_generation),
context,
)
for precondition in preconditions:
Expand Down

0 comments on commit bbc3fd6

Please sign in to comment.