-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to assure copyright text is the same (listed in 4 places)
- Loading branch information
Joseph Curtis
committed
Mar 31, 2021
1 parent
b7f650c
commit ca037fd
Showing
1 changed file
with
24 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Ensure the metadata is updated and valid.""" | ||
from utils import REPO_PATH | ||
import becquerel as bq | ||
|
||
COPYRIGHT = (REPO_PATH / "COPYRIGHT.txt").read_text().strip("\n") | ||
|
||
|
||
def test_copyright_in_license(): | ||
license = (REPO_PATH / "LICENSE.txt").read_text() | ||
copyright_in_license = ( | ||
license.split("*** Copyright Notice ***")[-1] | ||
.split("*** License Agreement ***")[0] | ||
.strip("\n") | ||
) | ||
assert COPYRIGHT == copyright_in_license | ||
|
||
|
||
def test_copyright_in_readme(): | ||
readme = (REPO_PATH / "README.md").read_text().strip("\n") | ||
assert readme.endswith(COPYRIGHT) | ||
|
||
|
||
def test_copyright_in_metadata(): | ||
assert bq.__metadata__.__copyright__.strip("\n") == COPYRIGHT |