Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update functional_tests.py #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/functional_tests/functional_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,14 @@ def test_verify_third_party_caveats(self):
discharge.add_first_party_caveat('time < 2015-01-01T00:00')
protected = m.prepare_for_request(discharge)

v = Verifier(discharge_macaroons=[protected])
v = Verifier()
v.satisfy_exact('account = 3735928559')
v.satisfy_exact('time < 2015-01-01T00:00')
verified = v.verify(
m,
'this is a different super-secret key; \
never use the same secret twice'
never use the same secret twice',
[protected]
)
assert verified

Expand All @@ -386,7 +387,7 @@ def test_verify_third_party_caveats_multi_level(self):
discharge1 = root.prepare_for_request(discharge1)
discharge2 = root.prepare_for_request(discharge2)

verified = Verifier(discharge_macaroons=[discharge1, discharge2]).verify(root, "root-key")
verified = Verifier().verify(root, "root-key", [discharge1, discharge2])
assert verified

@patch('nacl.secret.random')
Expand Down Expand Up @@ -421,4 +422,4 @@ def test_mutual_discharge(self):
m2.add_third_party_caveat("charlie", "bob-caveat-root-key", "bob-is-great")
m2 = m1.prepare_for_request(m2)
with pytest.raises(MacaroonUnmetCaveatException):
Verifier(discharge_macaroons=[m2]).verify(m1, "root-key")
Verifier().verify(m1, "root-key", [m2])