Skip to content

Commit 7dc06b9

Browse files
committed
Some pre-commit Python fixes
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 3e71165 commit 7dc06b9

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

test/test_container_httpd_s2i.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def test_self_cert_test(self):
168168
server_cert = ContainerTestLibUtils.run_command(
169169
cmd=f"openssl x509 -inform pem -noout -text -in {Path(certificate_dir)}/output"
170170
)
171-
config_cmd = f"openssl x509 -in {TEST_DIR}/{self.s2i_app.app_name}/httpd-ssl/certs/server-cert-selfsigned.pem -inform pem -noout -text"
171+
pem_file = f"{TEST_DIR}/{self.s2i_app.app_name}/httpd-ssl/certs/server-cert-selfsigned.pem"
172+
assert Path(pem_file).exists()
173+
config_cmd = f"openssl x509 -in {pem_file} -inform pem -noout -text"
172174
config_cert = ContainerTestLibUtils.run_command(cmd=config_cmd)
173175
assert server_cert == config_cert

test/test_ocp_ex_template.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
22
import sys
33

4-
import pytest
5-
64
from pathlib import Path
75

86
from container_ci_suite.openshift import OpenShiftAPI
@@ -19,7 +17,6 @@
1917

2018

2119
class TestHTTPDExExampleRepo:
22-
2320
def setup_method(self):
2421
self.template_name = get_service_image(IMAGE_NAME)
2522
self.oc_api = OpenShiftAPI(pod_name_prefix=self.template_name, version=VERSION)
@@ -30,10 +27,11 @@ def teardown_method(self):
3027
def test_httpd_ex_template_inside_cluster(self):
3128
assert self.oc_api.deploy_s2i_app(
3229
image_name=IMAGE_NAME,
33-
app=f"https://github.com/sclorg/httpd-ex#master",
34-
context="."
30+
app="https://github.com/sclorg/httpd-ex#master",
31+
context=".",
3532
)
3633
assert self.oc_api.is_template_deployed(name_in_template=self.template_name)
3734
assert self.oc_api.check_response_inside_cluster(
38-
name_in_template=self.template_name, expected_output="Welcome to your static httpd"
35+
name_in_template=self.template_name,
36+
expected_output="Welcome to your static httpd",
3937
)

test/test_ocp_imagestream_s2i.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
22
import sys
33

4-
import pytest
5-
64
from container_ci_suite.openshift import OpenShiftAPI
75
from container_ci_suite.utils import get_service_image, check_variables
86

@@ -17,7 +15,6 @@
1715

1816

1917
class TestHTTPDImagestreamS2I:
20-
2118
def setup_method(self):
2219
self.template_name = get_service_image(IMAGE_NAME)
2320
self.oc_api = OpenShiftAPI(pod_name_prefix=self.template_name, version=VERSION)
@@ -26,15 +23,16 @@ def teardown_method(self):
2623
self.oc_api.delete_project()
2724

2825
def test_inside_cluster(self):
29-
os_name = ''.join(i for i in OS if not i.isdigit())
26+
os_name = "".join(i for i in OS if not i.isdigit())
3027
assert self.oc_api.deploy_imagestream_s2i(
3128
imagestream_file=f"imagestreams/httpd-{os_name}.json",
3229
image_name=IMAGE_NAME,
3330
app="https://github.com/sclorg/httpd-container.git",
3431
context="examples/sample-test-app",
35-
service_name=self.template_name
32+
service_name=self.template_name,
3633
)
3734
assert self.oc_api.is_s2i_pod_running(pod_name_prefix=self.template_name)
3835
assert self.oc_api.check_response_inside_cluster(
39-
name_in_template=self.template_name, expected_output="This is a sample s2i application with static content"
36+
name_in_template=self.template_name,
37+
expected_output="This is a sample s2i application with static content",
4038
)

test/test_ocp_integration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class TestHTTPDIntegrationTemplate:
18-
1918
def setup_method(self):
2019
self.template_name = get_service_image(IMAGE_NAME)
2120
self.oc_api = OpenShiftAPI(pod_name_prefix=self.template_name, version=VERSION)
@@ -26,10 +25,11 @@ def teardown_method(self):
2625
def test_httpd_ex_template_inside_cluster(self):
2726
assert self.oc_api.deploy_s2i_app(
2827
image_name=IMAGE_NAME,
29-
app=f"https://github.com/sclorg/httpd-container.git",
30-
context="examples/sample-test-app"
28+
app="https://github.com/sclorg/httpd-container.git",
29+
context="examples/sample-test-app",
3130
)
3231
assert self.oc_api.is_template_deployed(name_in_template=self.template_name)
3332
assert self.oc_api.check_response_inside_cluster(
34-
name_in_template=self.template_name, expected_output="This is a sample s2i application with static content"
33+
name_in_template=self.template_name,
34+
expected_output="This is a sample s2i application with static content",
3535
)

0 commit comments

Comments
 (0)