Skip to content

Commit

Permalink
Update to support cisagov/skeleton-python-library v0.1.0
Browse files Browse the repository at this point in the history
Modify the Dockerfile to include new required arguments for the
`example` entrypoint. Update testing to check for the correct output
including new output since v0.0.1.
  • Loading branch information
mcdonnnj committed Sep 14, 2022
1 parent 1ad5f83 commit 1a61ac7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ USER cisa
EXPOSE 8080/TCP
VOLUME ["/var/log"]
ENTRYPOINT ["example"]
CMD ["--log-level", "DEBUG"]
CMD ["--log-level", "DEBUG", "4", "2"]
5 changes: 5 additions & 0 deletions tests/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

ENV_VAR = "ECHO_MESSAGE"
ENV_VAR_VAL = "Hello World from docker compose!"
DIVISION_RESULT = "4 / 2 == 2.000000"
READY_MESSAGE = "This is a debug message"
SECRET_QUOTE = (
"There are no secrets better kept than the secrets everybody guesses." # nosec
Expand Down Expand Up @@ -52,6 +53,10 @@ def test_output(main_container):
"""Verify the container had the correct output."""
main_container.wait() # make sure container exited if running test isolated
log_output = main_container.logs().decode("utf-8")
assert DIVISION_RESULT in log_output, "Division result not found in log output."
assert (
ENV_VAR_VAL in log_output
), "Environment variable value not found in log output."
assert SECRET_QUOTE in log_output, "Secret not found in log output."


Expand Down

0 comments on commit 1a61ac7

Please sign in to comment.