-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move to Hatch * Remove empty .gitmodules * Make packaging metadata dynamic * Get real version when checking package * Use real versions with system-package * Simplify tox.ini
- Loading branch information
Showing
8 changed files
with
136 additions
and
48 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
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 |
---|---|---|
|
@@ -4,7 +4,9 @@ | |
.coverage | ||
.coverage.* | ||
.direnv | ||
.envrc | ||
.hypothesis | ||
.mypy_cache | ||
.pytest_cache/ | ||
.tox | ||
.vscode | ||
|
Empty file.
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
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
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
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,55 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
import sys | ||
|
||
import pytest | ||
|
||
import argon2 | ||
|
||
|
||
if sys.version_info < (3, 8): | ||
import importlib_metadata as metadata | ||
else: | ||
from importlib import metadata | ||
|
||
|
||
class TestLegacyMetadataHack: | ||
def test_version(self): | ||
""" | ||
argon2.__version__ returns the correct version. | ||
""" | ||
with pytest.deprecated_call(): | ||
assert metadata.version("argon2-cffi") == argon2.__version__ | ||
|
||
def test_description(self): | ||
""" | ||
argon2.__description__ returns the correct description. | ||
""" | ||
with pytest.deprecated_call(): | ||
assert "Argon2 for Python" == argon2.__description__ | ||
|
||
def test_uri(self): | ||
""" | ||
argon2.__uri__ returns the correct project URL. | ||
""" | ||
with pytest.deprecated_call(): | ||
assert "https://argon2-cffi.readthedocs.io/" == argon2.__uri__ | ||
|
||
with pytest.deprecated_call(): | ||
assert "https://argon2-cffi.readthedocs.io/" == argon2.__url__ | ||
|
||
def test_email(self): | ||
""" | ||
argon2.__email__ returns Hynek's email address. | ||
""" | ||
with pytest.deprecated_call(): | ||
assert "hs@ox.cx" == argon2.__email__ | ||
|
||
def test_does_not_exist(self): | ||
""" | ||
Asking for unsupported dunders raises an AttributeError. | ||
""" | ||
with pytest.raises( | ||
AttributeError, match="module argon2 has no attribute __yolo__" | ||
): | ||
argon2.__yolo__ |
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