• R/O
  • SSH

MakePW: Commit

The main repository. Contains both Python and Javascript implementations.


Commit MetaInfo

Revision08390ed953e2c153ce8b15cdd892c54b5a707a14 (tree)
Time2019-03-30 16:47:03
AuthorEric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Add a test for XKCD format passwords.

Change Summary

Incremental Difference

diff -r 4630bb4131f7 -r 08390ed953e2 makepw_test.py
--- a/makepw_test.py Sun Feb 24 11:18:41 2019 -0800
+++ b/makepw_test.py Sat Mar 30 00:47:03 2019 -0700
@@ -154,3 +154,18 @@
154154 savedoutput = capsys.readouterr()
155155 assert savedoutput.err == ''
156156 assert savedoutput.out == 'check_site hash is: 5ncvmJZ/gnehSx\n0bw2H4*8Bjaal\n'
157+
158+
159+def test_xkcd_pw(monkeypatch):
160+ result = makepw.gen_xkcd_pw(4, b'\0'*32)
161+ assert result == 'TheTheTheThe'
162+ result = makepw.gen_xkcd_pw(5, b'\0'*32)
163+ assert result == 'TheTheTheTheThe'
164+ result = makepw.gen_xkcd_pw(6, b'\0'*32)
165+ assert result == 'TheTheTheTheTheThe'
166+ result = makepw.gen_xkcd_pw(4, b'\ff'*32)
167+ assert result == 'StickersCopOutdoorRapids'
168+ result = makepw.gen_xkcd_pw(5, b'\ff'*32)
169+ assert result == 'StickersCopOutdoorRapidsSon'
170+ result = makepw.gen_xkcd_pw(6, b'\ff'*32)
171+ assert result == 'StickersCopOutdoorRapidsSonArgue'
Show on old repository browser