Skip to content

Commit

Permalink
Added pytest dependency and run command to test.yml, moved the tests … (
Browse files Browse the repository at this point in the history
#5)

* Added pytest dependency and run command to test.yml, moved the tests to a tests directory and created three test definitions.

* Fix typo in test method name. Remove redundant test from yml. Remove the run from the Dockerfile.
  • Loading branch information
sergeihychko authored Dec 11, 2024
1 parent 58a9793 commit 1186a04
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ jobs:
steps:
- name: check out repository
uses: actions/checkout@v4
- name: test
run: docker build .
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
- name: Test with pytest
run: python -m pytest --doctest-modules
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ WORKDIR /app
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install rfc1924

RUN python3 ./rfc1924/test_rfc1924.py
6 changes: 0 additions & 6 deletions rfc1924/test_rfc1924.py

This file was deleted.

11 changes: 11 additions & 0 deletions rfc1924/tests/test_rfc1924.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from rfc1924 import *
import pytest

def test_encode():
assert encode("2345:425:2ca1::567:5673:23b5") == "AN?6(i3Y+yVr74uX@J3P"

def test_decode():
assert decode("AN?6(i3Y+yVr74uX@J3P") == "2345:425:2ca1::567:5673:23b5"

def test_savings():
assert (savings("2345:425:2ca1::567:5673:23b5") == 'You saved 28%')

0 comments on commit 1186a04

Please sign in to comment.