Skip to content

Commit

Permalink
Use the GenericTest::do_request instead of raw request to enable HTTP…
Browse files Browse the repository at this point in the history
…S and AUTH support
  • Loading branch information
lo-simon committed Mar 13, 2024
1 parent 57a4d79 commit c6e0864
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions nmostesting/suites/IS1101Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,7 @@ def test_02_03_04(self, test):
if len(inputs) == 0:
return test.UNCLEAR("No input supports changing the base EDID")
for input_id in inputs:
valid, response = TestHelper.do_request(
valid, response = self.do_request(
"GET", self.compat_url + "inputs/" + input_id + "/properties/"
)
if not valid:
Expand All @@ -2120,7 +2120,7 @@ def test_02_03_04(self, test):
return test.FAIL("Unable to find expected key: {}".format(e))
self.version[input_id] = version

valid, response = TestHelper.do_request(
valid, response = self.do_request(
"GET", self.node_url + "senders/" + sender_id
)
if not valid:
Expand All @@ -2136,14 +2136,16 @@ def test_02_03_04(self, test):
return test.FAIL("Unable to find expected key: {}".format(e))
self.version[sender_id] = version

response = requests.put(
self.compat_url + "inputs/" + input_id + "/edid/base/",
data=self.valid_edid,
valid, response = self.do_request("PUT",
self.compat_url + "inputs/" + input_id + "/edid/base",
headers={"Content-Type": "application/octet-stream"},
)
data=self.valid_edid)
if not valid or response.status_code != 204:
return test.FAIL("Unexpected response from "
"the Stream Compatibility Management API: {}".format(response))
time.sleep(CONFIG.STABLE_STATE_DELAY)

valid, response = TestHelper.do_request(
valid, response = self.do_request(
"GET", self.compat_url + "inputs/" + input_id + "/properties/"
)
if not valid:
Expand All @@ -2160,7 +2162,7 @@ def test_02_03_04(self, test):
if version == self.version[input_id]:
return test.FAIL("Version should change")

valid, response = TestHelper.do_request(
valid, response = self.do_request(
"GET", self.node_url + "senders/" + sender_id
)
if not valid:
Expand All @@ -2177,7 +2179,7 @@ def test_02_03_04(self, test):
if version == self.version[input_id]:
return test.FAIL("Version should change")

valid, response = TestHelper.do_request(
valid, response = self.do_request(
"DELETE", self.compat_url + "inputs/" + input_id + "/edid/base/"
)
if not valid:
Expand Down

0 comments on commit c6e0864

Please sign in to comment.