# limitations under the License. import fixtures import itertools import mock import os import requests from kolla.cmd import build as build_cmd from kolla import exception from kolla.image import build from kolla.tests import base FAKE_IMAGE = build.Image('image-base', 'image-base:latest', '/fake/path', parent_name=None, parent=None, status=build.STATUS_MATCHED) FAKE_IMAGE_CHILD = build.Image('image-child', 'image-child:latest', '/fake/path2', parent_name='image-base', parent=FAKE_IMAGE, status=build.STATUS_MATCHED) FAKE_IMAGE_CHILD_UNMATCHED = build.Image('image-child1', 'image-child:latest', '/fake/path3', parent_name='image-base', parent=FAKE_IMAGE, status=build.STATUS_UNMATCHED) FAKE_IMAGE_CHILD_ERROR = build.Image('image-child2',
import fixtures import itertools import os import requests import sys from unittest import mock from kolla.cmd import build as build_cmd from kolla import exception from kolla.image import build from kolla.tests import base FAKE_IMAGE = build.Image('image-base', 'image-base:latest', '/fake/path', parent_name=None, parent=None, status=build.Status.MATCHED) FAKE_IMAGE_CHILD = build.Image('image-child', 'image-child:latest', '/fake/path2', parent_name='image-base', parent=FAKE_IMAGE, status=build.Status.MATCHED) FAKE_IMAGE_CHILD_UNMATCHED = build.Image('image-child-unmatched', 'image-child-unmatched:latest', '/fake/path3', parent_name='image-base', parent=FAKE_IMAGE, status=build.Status.UNMATCHED) FAKE_IMAGE_CHILD_ERROR = build.Image('image-child-error',
# limitations under the License. import fixtures import itertools import mock import os import requests from kolla.cmd import build as build_cmd from kolla import exception from kolla.image import build from kolla.tests import base FAKE_IMAGE = build.Image('image-base', 'image-base:latest', '/fake/path', parent_name=None, parent=None, status=build.STATUS_MATCHED) FAKE_IMAGE_CHILD = build.Image('image-child', 'image-child:latest', '/fake/path2', parent_name='image-base', parent=FAKE_IMAGE, status=build.STATUS_MATCHED) class TasksTest(base.TestCase): def setUp(self): super(TasksTest, self).setUp() self.image = FAKE_IMAGE.copy() # NOTE(jeffrey4l): use a real, temporary dir
# See the License for the specific language governing permissions and # limitations under the License. import fixtures import itertools import mock import os import requests from kolla.cmd import build as build_cmd from kolla.image import build from kolla.tests import base FAKE_IMAGE = build.Image('image-base', 'image-base:latest', '/fake/path', parent_name=None, parent=None, status=build.STATUS_MATCHED) class TasksTest(base.TestCase): def setUp(self): super(TasksTest, self).setUp() self.image = FAKE_IMAGE.copy() # NOTE(jeffrey4l): use a real, temporary dir self.image.path = self.useFixture(fixtures.TempDir()).path @mock.patch.dict(os.environ, clear=True) @mock.patch('docker.Client') def test_push_image(self, mock_client): pusher = build.PushTask(self.conf, self.image)