Skip to content

Commit

Permalink
test_context_must_be_str
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663 committed Jan 7, 2022
1 parent adee0a4 commit ba13d28
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_blake3.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,14 @@ def test_keyword_only_arguments():
def test_usedforsecurity_ignored():
blake3(usedforsecurity=True)
blake3(usedforsecurity=False)


def test_context_must_be_str():
# string works
blake3(derive_key_context="foo")
try:
# bytes fails
blake3(derive_key_context=b"foo")
assert False, "should fail"
except TypeError:
pass

0 comments on commit ba13d28

Please sign in to comment.