-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding test for copyright in
__init__.py
- Loading branch information
1 parent
7699984
commit 0f790cf
Showing
2 changed files
with
27 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
from __future__ import annotations | ||
|
||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
from screenpy import __version__ | ||
|
||
|
||
def test_metadata() -> None: | ||
assert __version__.__title__ == "screenpy" | ||
assert __version__.__license__ == "MIT" | ||
assert __version__.__author__ == "Perry Goy" | ||
|
||
|
||
def test_copyright_year() -> None: | ||
current = datetime.now().year | ||
|
||
assert f"{current}" in __version__.__copyright__ | ||
|
||
|
||
def test_copyright_year_in_license() -> None: | ||
current = datetime.now().year | ||
license_path = Path(__file__).parent / ".." / "LICENSE" | ||
with open(license_path) as fp: | ||
license_text = fp.read() | ||
|
||
assert f"{current}" in license_text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from __future__ import annotations | ||
|
||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from screenpy import __doc__, __version__ | ||
|
||
|
||
class TestCopyrightYear: | ||
@pytest.fixture(autouse=True) | ||
def _setup(self) -> None: | ||
self.current_year = datetime.now().year | ||
|
||
def test_version(self) -> None: | ||
assert f"{self.current_year}" in __version__.__copyright__ | ||
|
||
def test_license(self) -> None: | ||
license_path = Path(__file__).parent / ".." / "LICENSE" | ||
with open(license_path) as fp: | ||
license_text = fp.read() | ||
|
||
assert f"{self.current_year}" in license_text | ||
|
||
def test_init(self) -> None: | ||
assert f"{self.current_year}" in __doc__ |