Skip to content

Commit

Permalink
Test-case for OSBS.create_prod_build()
Browse files Browse the repository at this point in the history
  • Loading branch information
twaugh committed Jul 29, 2015
1 parent f4a85f0 commit 777f6f5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from __future__ import absolute_import, unicode_literals

TEST_BUILD = "test-build-123"
TEST_GIT_URI = "git://hostname/path"
TEST_GIT_REF = "master"
TEST_USER = "user"
TEST_COMPONENT = "component"
TEST_TARGET = "target"
TEST_ARCH = "x86_64"
TEST_BUILD_POD = "build-test-build-123"
TEST_LABEL = "test-label"
TEST_LABEL_VALUE = "sample-value"
Expand Down
7 changes: 7 additions & 0 deletions tests/fake_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def osbs(openshift):
build_json_dir = {build_json_dir}
[default]
openshift_uri = https://0.0.0.0/
registry_uri = registry.example.com
sources_command = fedpkg sources
vendor = Example, Inc.
build_host = localhost
authoritative_registry = registry.example.com
koji_root = http://koji.example.com/kojiroot
koji_hub = http://koji.example.com/kojihub
build_type = simple
""".format (build_json_dir="inputs"))
fp.flush()
Expand Down
8 changes: 8 additions & 0 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
from osbs.exceptions import OsbsValidationException
from osbs.http import Response
from tests.constants import TEST_BUILD, TEST_LABEL, TEST_LABEL_VALUE
from tests.constants import TEST_GIT_URI, TEST_GIT_REF, TEST_USER
from tests.constants import TEST_COMPONENT, TEST_TARGET, TEST_ARCH
from tests.fake_api import ResponseMapping, DEFINITION


Expand Down Expand Up @@ -525,6 +527,12 @@ def test_list_builds_api(osbs):
assert isinstance(response_list[0], BuildResponse)


def test_create_prod_build(osbs):
response = osbs.create_prod_build(TEST_GIT_URI, TEST_GIT_REF, TEST_USER,
TEST_COMPONENT, TEST_TARGET, TEST_ARCH)
assert isinstance(response, BuildResponse)


def test_wait_for_build_to_finish(osbs):
build_response = osbs.wait_for_build_to_finish(TEST_BUILD)
assert isinstance(build_response, BuildResponse)
Expand Down

0 comments on commit 777f6f5

Please sign in to comment.