summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-23 16:37:10 +0100
committerGitHub <noreply@github.com>2021-01-23 16:37:10 +0100
commit3f5af4e80686cb732730bd27fe7fc1c64580c494 (patch)
treeff3c4b2e9be5d8baf931dce0c7021a78718e8f5f
parent6cef7c78dd5f8e2e8e1fe91bd2c7d1298f7e4df9 (diff)
parentc182091b0222107f8549ff6f0e2f84d84356d1f2 (diff)
downloadpodman-3f5af4e80686cb732730bd27fe7fc1c64580c494.tar.gz
podman-3f5af4e80686cb732730bd27fe7fc1c64580c494.tar.bz2
podman-3f5af4e80686cb732730bd27fe7fc1c64580c494.zip
Merge pull request #9073 from mlegenovic/master
Small API test improvement for compatibility search endpoint
-rw-r--r--test/apiv2/rest_api/test_rest_v2_0_0.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/test/apiv2/rest_api/test_rest_v2_0_0.py b/test/apiv2/rest_api/test_rest_v2_0_0.py
index 5676ff65d..77674e81b 100644
--- a/test/apiv2/rest_api/test_rest_v2_0_0.py
+++ b/test/apiv2/rest_api/test_rest_v2_0_0.py
@@ -374,13 +374,13 @@ class TestApi(unittest.TestCase):
self.assertEqual(len(objs), 1)
def do_search3():
- payload = {'term': 'alpine', 'filters': {'is-official': True}}
+ payload = {'term': 'alpine', 'filters': '{"is-official":["true"]}'}
r = requests.get(url, params=payload, timeout=5)
self.assertEqual(r.status_code, 200, r.text)
objs = json.loads(r.text)
self.assertIn(type(objs), (list,))
-# TODO: Request should return only one item, but it returns more. For now this check is commented out.
-# self.assertEqual(len(objs), 1)
+ # There should be only one offical image
+ self.assertEqual(len(objs), 1)
def do_search4():
headers = {'X-Registry-Auth': 'null'}
@@ -401,19 +401,6 @@ class TestApi(unittest.TestCase):
search.join(timeout=10)
self.assertFalse(search.is_alive(), "/images/search took too long")
- def test_search_compat_with_(self):
- # Had issues with this test hanging when repositories not happy
- def do_search():
- r = requests.get(PODMAN_URL + "/v1.40/images/search?term=alpine", timeout=5)
- self.assertEqual(r.status_code, 200, r.text)
- objs = json.loads(r.text)
- self.assertIn(type(objs), (list,))
-
- search = Process(target=do_search)
- search.start()
- search.join(timeout=10)
- self.assertFalse(search.is_alive(), "/images/search took too long")
-
def test_ping(self):
required_headers = (
"API-Version",