Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric05 committed Jan 13, 2025
1 parent e1ff208 commit 7f40999
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def get_request(file, env=None, prop=None, properties=None, target=None):
file, env, prop, properties, target=target
).get_request()

@staticmethod
def get_request_comp(file, env=None, prop=None, properties=None, target=None):
return TestBase.get_req_comp(
file, env, prop, properties, target=target
)

@staticmethod
def get_req_comp(
file,
Expand Down
4 changes: 3 additions & 1 deletion test/core/test_certs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class CertUnitTest(TestBase):
def test_fail_no_property_certificate(self):
with self.assertRaises(PropertyNotFoundException):
filename = f"{http_base}/no-password.http"
self.get_request(filename, target="no-password")
comp = self.get_request_comp(filename, target="no-password")
comp.get_request()
raise comp.property_util.errors[0]

def test_certificate_available(self):
filename = f"{http_base}/no-password.http"
Expand Down
4 changes: 3 additions & 1 deletion test/core/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ def test_property_file_not_json(self):

def test_property_not_found(self):
with self.assertRaises(PropertyNotFoundException):
self.get_request(
comp = self.get_request_comp(
f"{sub_base_path}/multipleprop.http", prop=f"{sub_base_path}/prop1.json"
)
comp.get_request()
raise comp.property_util.errors[0]

def test_commmand_line_not_found(self):
with self.assertRaises(CommandLinePropError):
Expand Down
4 changes: 3 additions & 1 deletion test/core/test_multidef_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def test_infileunresolved_prop_http(self):
# should run as it is not using any vars
with self.assertRaises(PropertyNotFoundException):
# should fail with unresolved properties
self.get_request(f"{base_dir}/multi.http", target=5)
comp = self.get_request_comp(f"{base_dir}/multi.http", target=5)
comp.get_request()
raise comp.property_util.errors[0]
# should pass when required properties are sent
req = self.get_request(
f"{base_dir}/multi.http",
Expand Down

0 comments on commit 7f40999

Please sign in to comment.