Add the basics of geographic data distribution and get the tests to work.

This commit is contained in:
Jake Moshenko 2014-06-17 16:03:43 -04:00
parent 2bf12996f5
commit bf98575feb
23 changed files with 198 additions and 100 deletions

View file

@ -3,7 +3,7 @@ import json as py_json
from flask import url_for
from endpoints.api import api
from app import app
from app import app, storage
from initdb import setup_database_for_testing, finished_database_for_testing
from data import model
@ -43,7 +43,9 @@ class TestImageSharing(unittest.TestCase):
def createStorage(self, docker_image_id, repository=REPO, username=ADMIN_ACCESS_USER):
repository_obj = model.get_repository(repository.split('/')[0], repository.split('/')[1])
image = model.find_create_or_link_image(docker_image_id, repository_obj, username, {})
preferred = storage.preferred_locations[0]
image = model.find_create_or_link_image(docker_image_id, repository_obj, username, {},
preferred)
return image.storage.id
def assertSameStorage(self, docker_image_id, storage_id, repository=REPO, username=ADMIN_ACCESS_USER):