Skip to content

Commit 005d295

Browse files
committed
Remove some leftovers caused by review
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent b18b196 commit 005d295

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

test/test_container_basics.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def setup_method(self):
1515
def teardown_method(self):
1616
self.app.cleanup()
1717

18-
def test_run_s2i_usage(self, app):
18+
def test_run_s2i_usage(self):
1919
"""
2020
Test if s2i usage works
2121
"""
22-
output = app.s2i_usage()
22+
output = self.app.s2i_usage()
2323
assert output != ""
2424

2525
def test_docker_run_usage(self):
@@ -47,7 +47,7 @@ def test_scl_usage(self):
4747
"Dockerfile.s2i"
4848
]
4949
)
50-
def test_dockerfiles(self, app, dockerfile):
50+
def test_dockerfiles(self, dockerfile):
5151
"""
5252
Test if building nginx-container based on
5353
examples/Dockerfile works
@@ -58,11 +58,11 @@ def test_dockerfiles(self, app, dockerfile):
5858
dp.update_variable_in_dockerfile(version=version, variable="NGINX_VERSION")
5959
new_docker_file = dp.create_temp_dockerfile()
6060

61-
assert app.build_test_container(
61+
assert self.app.build_test_container(
6262
dockerfile=new_docker_file, app_url="https://github.com/sclorg/nginx-container.git",
6363
app_dir="nginx-container"
6464
)
65-
assert app.test_app_dockerfile()
66-
cip = app.get_cip()
65+
assert self.app.test_app_dockerfile()
66+
cip = self.app.get_cip()
6767
assert cip
68-
assert app.test_response(url=cip, expected_output="NGINX is working")
68+
assert self.app.test_response(url=cip, expected_output="NGINX is working")

test/test_container_example_apps.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def setup_method(self):
4040
def teardown_method(self):
4141
self.s2i_app.cleanup()
4242

43-
def test_run_app_test(self, example_app_test):
43+
def test_run_app_test(self):
4444
version = VERSION.replace("-micro", "")
45-
cid_file_name = example_app_test.app_name
45+
cid_file_name = self.s2i_app.app_name
4646
# Create container with --user 10001
4747
assert self.s2i_app.create_container(cid_file_name=cid_file_name, container_args="--user 10001")
4848
# Wait till container does not start
@@ -59,7 +59,7 @@ def test_run_app_test(self, example_app_test):
5959
# Checks if nginx configuration DO NOT container "DNS_SERVER"
6060
assert not re.search("DNS_SERVER", command)
6161
assert PodmanCLIWrapper.podman_run_command(
62-
f"--rm {example_app_test.image_name} /bin/bash -c 'nginx -v'"
62+
f"--rm {self.s2i_app.image_name} /bin/bash -c 'nginx -v'"
6363
).startswith(f"nginx version: nginx/{version}")
6464
assert self.s2i_app.test_response(
6565
url=f"http://{cip}", expected_output="NGINX is working"
@@ -111,9 +111,9 @@ def setup_method(self):
111111
def teardown_method(self):
112112
self.s2i_app.cleanup()
113113

114-
def test_log_output(self, s2i_log_test):
114+
def test_log_output(self):
115115
cid_file_name = "test-app"
116-
s2i_log_test.set_new_image(image_name=f"{IMAGE_NAME}-{cid_file_name}")
116+
self.s2i_app.set_new_image(image_name=f"{IMAGE_NAME}-{cid_file_name}")
117117
assert self.s2i_app.create_container(
118118
cid_file_name=cid_file_name,
119119
container_args="--user 10001"
@@ -124,7 +124,7 @@ def test_log_output(self, s2i_log_test):
124124
assert self.s2i_app.test_response(
125125
url=f"http://{cip}", port=8080, expected_output="NGINX is working"
126126
)
127-
assert '"GET / HTTP/1.1" 200' in s2i_log_test.get_logs(cid_file_name=cid_file_name)
127+
assert '"GET / HTTP/1.1" 200' in self.s2i_app.get_logs(cid_file_name=cid_file_name)
128128
# Check if /nothing-at-all is really no accessible
129129
assert self.s2i_app.test_response(
130130
url=f"http://{cip}", port=8080, page="/nothing-at-all", expected_code=404
@@ -134,9 +134,9 @@ def test_log_output(self, s2i_log_test):
134134
# Checks logs container 'failed' and 'No such file or directory'
135135
assert re.search("open.*failed.*No such file or directory", logs)
136136

137-
def test_log_volume_output(self, s2i_log_test):
137+
def test_log_volume_output(self):
138138
cid_file_name = "test-app"
139-
s2i_log_test.set_new_image(image_name=f"{IMAGE_NAME}-{cid_file_name}")
139+
self.s2i_app.set_new_image(image_name=f"{IMAGE_NAME}-{cid_file_name}")
140140
assert self.s2i_app.create_container(
141141
cid_file_name=cid_file_name,
142142
container_args="-e NGINX_LOG_TO_VOLUME=y --user 10001"

0 commit comments

Comments
 (0)