tests: Make sure example-development is present for delete test

Use it for the save, delete, push testing for composer-cli
tests. Otherwise the test runs fine the first time and fails after that
if you don't re-install the test environment.

Related: rhbz#1678937
This commit is contained in:
Brian C. Lane 2019-04-03 14:25:48 -07:00
parent 6242ae8b18
commit dd2446faf6
3 changed files with 10 additions and 9 deletions

View File

@ -73,22 +73,23 @@ class BlueprintsTest(unittest.TestCase):
self.assertTrue("example-http-server" in output)
self.assertTrue("Recipe example-http-server, version 0.0.1 saved." in output)
# NOTE: Order of these 3 is important, delete needs to come after save, before push and these 3
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
def test_save_0(self):
"""blueprints save"""
blueprints_save("/run/weldr/api.socket", 0, ["example-http-server"], show_json=False)
"""blueprints save example-development"""
blueprints_save("/run/weldr/api.socket", 0, ["example-development"], show_json=False)
self.assertTrue(os.path.exists("example-http-server.toml"))
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
def test_save_1(self):
"""blueprints push"""
rc = blueprints_push("/run/weldr/api.socket", 0, ["example-http-server.toml"], show_json=False)
"""blueprints delete example-development"""
rc = blueprints_delete("/run/weldr/api.socket", 0, ["example-development"], show_json=False)
self.assertTrue(rc == 0)
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
def test_delete(self):
"""blueprints delete"""
rc = blueprints_delete("/run/weldr/api.socket", 0, ["example-development"], show_json=False)
def test_save_2(self):
"""blueprints push example-development"""
rc = blueprints_push("/run/weldr/api.socket", 0, ["example-development.toml"], show_json=False)
self.assertTrue(rc == 0)
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")

View File

@ -7,5 +7,5 @@ metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-single-repo-test
skip_if_unavailable=False

View File

@ -296,7 +296,7 @@ def singlerepo():
"check_gpg": True,
"check_ssl": True,
"gpgkey_urls": [
"file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64"
"file:///etc/pki/rpm-gpg/RPM-GPG-KEY-single-repo-test"
],
"name": "single-repo",
"system": False,