Closed bee-san closed 3 years ago
Hi @bee-san! I just saw that the tests from my PR #92 that was aimed to solve this issue are actually failing and I cannot figure out why. The error is in the test_main.py in the latest Office hash test.
Hash name in tests is the same as name in the database and the regex matches the hash so the test should be successful. This is the error message:
tests/test_main.py:226: AssertionError =========================== short test summary info ============================ FAILED tests/test_main.py::test_office - assert 'MS Office ⇐ 2003 $0/$1, MD5 ... ========================= 1 failed, 35 passed in 0.28s ========================= Command poetry run pytest failed with exit code 1 Session tests failed. Error: Process completed with exit code 1.
It's probably string matching, it's quite hard to match entire strings like that. Specifically ⇐
might be breaking it? I would assert using regex here :)
I also thought that maybe some character in the name is causing this error. So asserting regex like this
assert "\$oldoffice\$[a-f0-9*]{100}:[a-f0-9]{10}" in x
instead of the name should make the test work?
That's so advanced! I would do:
assert re.find("MS Office", x)
I think that'd work?
True that would cause even more errors hahah. Will open a new PR now with what you suggested. :D
Make sure to run pytest
to test it! :-)
https://github.com/HashPals/Name-That-Hash/pull/69#issue-596748318
^^ That PR already contains the stuff. Make a new PR (or fix the merge conflicts + tests) to contribute && finish this issue :)