From d964e7fc6a644196993121f98f09bc66cd0e181d Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Wed, 8 Jan 2020 09:23:46 -0800 Subject: Add secure generate function --- tests/test_alphanum.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test_alphanum.py') diff --git a/tests/test_alphanum.py b/tests/test_alphanum.py index fc9bc41..d567bdb 100644 --- a/tests/test_alphanum.py +++ b/tests/test_alphanum.py @@ -15,3 +15,19 @@ def test_subsequent_strings_differ(): foo = alphanum.generate(10) bar = alphanum.generate(10) assert foo != bar + + +def test_secure_no_string_length(): + foo = alphanum.generate_s() + assert len(foo) == 1 + + +def test_secure_with_string_length(): + foo = alphanum.generate_s(10) + assert len(foo) == 10 + + +def test_secure_subsequent_strings_differ(): + foo = alphanum.generate_s(10) + bar = alphanum.generate_s(10) + assert foo != bar -- cgit v1.2.3