diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 496a5a5..3fb7fac 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -82,7 +82,7 @@ jobs: path: dist/ - name: Publish package - uses: pypa/gh-action-pypi-publish@v.1.13.0 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/tests/unit/test_oligos.py b/tests/unit/test_oligos.py index 6da7734..cf8414f 100644 --- a/tests/unit/test_oligos.py +++ b/tests/unit/test_oligos.py @@ -67,6 +67,21 @@ def inner(s: str, *args) -> Any: return inner +def wrap_slice(f: Callable[[str], Any]) -> Callable[[str], str]: + """Wrap a function which uses a string, and returns a substring output.""" + + @wraps(f) + def inner(s: str, *args) -> str: + b: bytes = s.encode("utf8") + ba: bytearray = bytearray(b) + m: memoryview = memoryview(ba) + a, b = f(m, *args) + + return s[a:b] + + return inner + + @pytest.mark.parametrize( "function", [ @@ -202,6 +217,8 @@ def test_reverse_complement( ("AAT", 1), ("ATGC", 0), ("AAAAACCCCCCGGGGGGG", 6), + ("A" * 10 + "T", 9), + ("T" + "A" * 10, 9), ], ) def test_stretch(seq, expected: int, function: Callable[[str], int]) -> None: @@ -250,6 +267,7 @@ def test_nrepeats( "function", [ oligos.palindrome, + wrap_slice(_oligos.m_palindrome), oligos.palindrome_py, oligos.manacher, ],