Add a test api to test repositories which are currenlty building.
This commit is contained in:
parent
ffc33e454c
commit
684ce83058
6 changed files with 29 additions and 7 deletions
15
initdb.py
15
initdb.py
|
@ -5,6 +5,7 @@ import os
|
|||
import hashlib
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from flask import url_for
|
||||
|
||||
import storage
|
||||
|
||||
|
@ -95,6 +96,8 @@ def __generate_repository(user, name, description, is_public, permissions,
|
|||
|
||||
create_subtree(repo, structure, None)
|
||||
|
||||
return repo
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
initialize_db()
|
||||
|
@ -141,6 +144,12 @@ if __name__ == '__main__':
|
|||
'Shared repository, another user can write.', False,
|
||||
[(new_user_2, 'write')], (5, [], 'latest'))
|
||||
|
||||
__generate_repository(new_user_1, 'empty',
|
||||
'Empty repository with no images or tags.', False,
|
||||
[], (0, [], None))
|
||||
building = __generate_repository(new_user_1, 'building',
|
||||
'Empty repository which is building.',
|
||||
False, [], (0, [], None))
|
||||
|
||||
build = model.create_repository_build(building, '123-45-6789')
|
||||
build.build_node_id = 1
|
||||
build.phase = 'building'
|
||||
build.status_url = 'http://localhost:5000/test/build/status'
|
||||
build.save()
|
||||
|
|
Reference in a new issue