-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from KPrasch/monkeytype
PEP 484 Type Hints for pyUmbral
- Loading branch information
Showing
15 changed files
with
290 additions
and
185 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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
[mypy] | ||
python_version=3.6 | ||
verbosity=1 | ||
verbosity=0 | ||
ignore_missing_imports=True | ||
[mypy-umbral.*] | ||
disallow_untyped_defs=True | ||
disallow_untyped_defs=False | ||
check_untyped_defs=False | ||
disallow_untyped_calls=True | ||
disallow_untyped_calls=False | ||
[mypy-umbral.openssl] | ||
disallow_untyped_defs=False |
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,62 @@ | ||
from collections import namedtuple | ||
|
||
import pytest | ||
|
||
from umbral import keys | ||
from umbral.curvebn import CurveBN | ||
from umbral.point import Point | ||
|
||
MockKeyPair = namedtuple('TestKeyPair', 'priv pub') | ||
|
||
|
||
parameters = [ | ||
# (N, M) | ||
(1, 1), | ||
(6, 1), | ||
(6, 4), | ||
(6, 6), | ||
(50, 30) | ||
] | ||
|
||
wrong_parameters = [ | ||
# (N, M) | ||
(-1, -1), (-1, 0), (-1, 5), | ||
(0, -1), (0, 0), (0, 5), | ||
(1, -1), (1, 0), (1, 5), | ||
(5, -1), (5, 0), (5, 10) | ||
] | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def alices_keys(): | ||
delegating_priv = keys.UmbralPrivateKey.gen_key() | ||
signing_priv = keys.UmbralPrivateKey.gen_key() | ||
return delegating_priv, signing_priv | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def bobs_keys(): | ||
priv = keys.UmbralPrivateKey.gen_key() | ||
pub = priv.get_pubkey() | ||
return MockKeyPair(priv, pub) | ||
|
||
|
||
@pytest.fixture() | ||
def random_ec_point1(): | ||
yield Point.gen_rand() | ||
|
||
|
||
@pytest.fixture() | ||
def random_ec_point2(): | ||
yield Point.gen_rand() | ||
|
||
|
||
@pytest.fixture() | ||
def random_ec_curvebn1(): | ||
yield CurveBN.gen_rand() | ||
|
||
|
||
@pytest.fixture() | ||
def random_ec_curvebn2(): | ||
yield CurveBN.gen_rand() | ||
|
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
Oops, something went wrong.