summaryrefslogtreecommitdiff
path: root/test/apiv2/python/rest_api
diff options
context:
space:
mode:
authorCharlie Doern <cdoern@redhat.com>2021-06-08 15:47:44 -0400
committerGitHub <noreply@github.com>2021-06-08 15:47:44 -0400
commitda1bade294025a419877484ae35f352984e804d2 (patch)
treecbc2e03595a15cdaa19870ebb00e5248a1360aa0 /test/apiv2/python/rest_api
parent9938557a53ed6599267ed1f8c0b6378499ab8e28 (diff)
parent5117deda04b765cd3dc7bd454286764a7c1ea6bc (diff)
downloadpodman-da1bade294025a419877484ae35f352984e804d2.tar.gz
podman-da1bade294025a419877484ae35f352984e804d2.tar.bz2
podman-da1bade294025a419877484ae35f352984e804d2.zip
Merge pull request #10603 from cdoern/networksQuery
implemented verbose and scope as possible
Diffstat (limited to 'test/apiv2/python/rest_api')
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_network.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/apiv2/python/rest_api/test_v2_0_0_network.py b/test/apiv2/python/rest_api/test_v2_0_0_network.py
index 3888123fb..d606b9351 100644
--- a/test/apiv2/python/rest_api/test_v2_0_0_network.py
+++ b/test/apiv2/python/rest_api/test_v2_0_0_network.py
@@ -102,6 +102,33 @@ class NetworkTestCase(APITestCase):
"TestNetwork",
payload["NetworkSettings"]["Networks"]["TestNetwork"]["NetworkID"],
)
+ def test_inspect(self):
+ name = f"Network_{random.getrandbits(160):x}"
+ create = requests.post(self.podman_url + "/v1.40/networks/create", json={"Name": name})
+ self.assertEqual(create.status_code, 201, create.text)
+ self.assertId(create.content)
+
+ net = create.json()
+ self.assertIsInstance(net, dict)
+ self.assertNotEqual(net["Id"], name)
+ ident = net["Id"]
+
+ ls = requests.get(self.podman_url + "/v1.40/networks")
+ self.assertEqual(ls.status_code, 200, ls.text)
+
+ networks = ls.json()
+ self.assertIsInstance(networks, list)
+
+ found = False
+ for net in networks:
+ if net["Name"] == name:
+ found = True
+ break
+ self.assertTrue(found, f"Network '{name}' not found")
+
+ inspect = requests.get(self.podman_url + f"/v1.40/networks/{ident}?verbose=false&scope=local")
+ self.assertEqual(inspect.status_code, 200, inspect.text)
+
def test_crud(self):
name = f"Network_{random.getrandbits(160):x}"