Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added quick test for working solution
- Loading branch information
James Shuttleworth
committed
Oct 1, 2021
1 parent
5a1f3bb
commit 1b36ce17a1fab89a8aa142014b14b3d51fe2e315
Showing
3 changed files
with
15 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4,3 +4,4 @@ | ||
/src/answer.py | ||
/html/ | ||
/submission/5062CEM_2021_22_SepJan_CW1_main_sit_0123456789.html | ||
/tests/__pycache__/ |
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,4 +1,4 @@ | ||
simple-term-menu | ||
pdoc3 | ||
markdown | ||
|
||
pytest |
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,13 @@ | ||
import pytest | ||
import sys | ||
sys.path.append("./src/") | ||
import rainbow_generator | ||
import pearson | ||
|
||
flag="MzZwcx15NHQzOnxzcnI9cjk=" | ||
|
||
|
||
def test_generator(): | ||
d=rainbow_generator.generateTable(["test1", "test2", "test3"], lambda x: pearson.hashN(x,2), rainbow_generator.makeGuess, 20, 3, 6, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') | ||
|
||
assert d=={b'fa': 'test1', b'=\xcd': 'test2', b'\x0b\n': 'test3'} |