From bb0c976bc836353983f0fcfa58e940be8a5e504d Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Thu, 29 Feb 2024 18:58:34 +0200 Subject: [PATCH] test: add a simple test --- Makefile | 4 ++-- setup.py | 2 +- src/papis_abbrev/command.py | 2 +- test/test_abbrev.py | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 test/test_abbrev.py diff --git a/Makefile b/Makefile index f5a46ff..7d08601 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ ruff: ## Run ruff checks over the source code .PHONY: ruff mypy: ## Run mypy checks over the source code - $(PYTHON) -m mypy src + $(PYTHON) -m mypy src test @echo -e "\e[1;32mmypy (strict) clean!\e[0m" .PHONY: mypy @@ -50,7 +50,7 @@ codespell: ## Run codespell checks over the documentation --skip _build \ --uri-ignore-words-list '*' \ --ignore-words .codespell-ignore \ - src test + src test docs @echo -e "\e[1;32mcodespell clean!\e[0m" .PHONY: codespell diff --git a/setup.py b/setup.py index 2a131ed..6e96e8e 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 Alexandru Fikl +# SPDX-FileCopyrightText: 2024 Alexandru Fikl # SPDX-License-Identifier: MIT from setuptools import setup diff --git a/src/papis_abbrev/command.py b/src/papis_abbrev/command.py index a54355d..7ed304b 100644 --- a/src/papis_abbrev/command.py +++ b/src/papis_abbrev/command.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 Alexandru Fikl +# SPDX-FileCopyrightText: 2024 Alexandru Fikl # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/test/test_abbrev.py b/test/test_abbrev.py new file mode 100644 index 0000000..6156b61 --- /dev/null +++ b/test/test_abbrev.py @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2024 Alexandru Fikl +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import pytest + + +def test_pyiso4() -> None: + ltwa = pytest.importorskip("pyiso4.ltwa") + + abbrev = ltwa.Abbreviate.create() + result = abbrev("Journal of Computational Physics", remove_part=True) + assert result == "J. Comput. Phys."