Fixing missing dash in datastore query (#4213)

This commit is contained in:
kabeer27 2020-07-29 13:02:54 +05:30 committed by GitHub
parent eb19f16419
commit 5893c61c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ MAX_BUILD_HISTORY_LENGTH = 64
def update_build_history(project_name, build_id, build_tag):
"""Update build history of project."""
project_key = ndb.Key(BuildsHistory, project_name + build_tag)
project_key = ndb.Key(BuildsHistory, project_name + '-' + build_tag)
project = project_key.get()
if not project:

View File

@ -82,7 +82,7 @@ class TestRequestBuilds(unittest.TestCase):
build_tag='fuzzing',
project='test-project',
build_ids=[str(i) for i in range(1, 65)]).put()
update_build_history('test-project', '65', '-fuzzing')
update_build_history('test-project', '65', 'fuzzing')
expected_build_ids = [str(i) for i in range(2, 66)]
self.assertEqual(BuildsHistory.query().get().build_ids,