Skip to content

Commit

Permalink
Updated sleep for the server and updated the dockerfile to copy all p…
Browse files Browse the repository at this point in the history
…y files.
  • Loading branch information
Ronster2018 committed Nov 5, 2024
1 parent ad13379 commit bb017de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM python:3-slim

WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

COPY index.html python_docker_test.sh test_python_server.py /
COPY index.html python_docker_test.sh *.py /app/
EXPOSE 7000

CMD python3 -m http.server 7000
Expand Down
2 changes: 1 addition & 1 deletion test_python_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def setUpClass(cls):
cls.server_thread = threading.Thread(target=run_server)
cls.server_thread.daemon = True
cls.server_thread.start()
time.sleep(1)
time.sleep(5)
def test_index_htlp_served(self):
response = requests.get("http://localhost:7000/index.html")
self.assertEqual(response.status_code, 200)
Expand Down

0 comments on commit bb017de

Please sign in to comment.