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:
parent
6242ae8b18
commit
dd2446faf6
@ -73,22 +73,23 @@ class BlueprintsTest(unittest.TestCase):
|
|||||||
self.assertTrue("example-http-server" in output)
|
self.assertTrue("example-http-server" in output)
|
||||||
self.assertTrue("Recipe example-http-server, version 0.0.1 saved." 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")
|
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
||||||
def test_save_0(self):
|
def test_save_0(self):
|
||||||
"""blueprints save"""
|
"""blueprints save example-development"""
|
||||||
blueprints_save("/run/weldr/api.socket", 0, ["example-http-server"], show_json=False)
|
blueprints_save("/run/weldr/api.socket", 0, ["example-development"], show_json=False)
|
||||||
self.assertTrue(os.path.exists("example-http-server.toml"))
|
self.assertTrue(os.path.exists("example-http-server.toml"))
|
||||||
|
|
||||||
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
||||||
def test_save_1(self):
|
def test_save_1(self):
|
||||||
"""blueprints push"""
|
"""blueprints delete example-development"""
|
||||||
rc = blueprints_push("/run/weldr/api.socket", 0, ["example-http-server.toml"], show_json=False)
|
rc = blueprints_delete("/run/weldr/api.socket", 0, ["example-development"], show_json=False)
|
||||||
self.assertTrue(rc == 0)
|
self.assertTrue(rc == 0)
|
||||||
|
|
||||||
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
||||||
def test_delete(self):
|
def test_save_2(self):
|
||||||
"""blueprints delete"""
|
"""blueprints push example-development"""
|
||||||
rc = blueprints_delete("/run/weldr/api.socket", 0, ["example-development"], show_json=False)
|
rc = blueprints_push("/run/weldr/api.socket", 0, ["example-development.toml"], show_json=False)
|
||||||
self.assertTrue(rc == 0)
|
self.assertTrue(rc == 0)
|
||||||
|
|
||||||
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
@unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server")
|
||||||
|
@ -7,5 +7,5 @@ metadata_expire=7d
|
|||||||
repo_gpgcheck=0
|
repo_gpgcheck=0
|
||||||
type=rpm
|
type=rpm
|
||||||
gpgcheck=1
|
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
|
skip_if_unavailable=False
|
||||||
|
@ -296,7 +296,7 @@ def singlerepo():
|
|||||||
"check_gpg": True,
|
"check_gpg": True,
|
||||||
"check_ssl": True,
|
"check_ssl": True,
|
||||||
"gpgkey_urls": [
|
"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",
|
"name": "single-repo",
|
||||||
"system": False,
|
"system": False,
|
||||||
|
Loading…
Reference in New Issue
Block a user