Skip to content

Commit

Permalink
more tests and bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mebus committed Nov 21, 2018
1 parent 3b597c7 commit 8c7d11d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cupp.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def improve_dictionary(file_to_open):

unique_list_finished = [x for x in unique_list if len(x) > wcfrom and len(x) < wcto]

print_to_file(sys.argv[2] + ".cupp.txt", unique_list_finished)
print_to_file(file_to_open + ".cupp.txt", unique_list_finished)

fajl.close()

Expand Down
16 changes: 15 additions & 1 deletion test_cupp.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def test_parser(self):
download_wordlist_http("16")

filename = "dictionaries/hindi/hindu-names.gz"

self.assertTrue(os.path.isfile(filename), "file " + filename + "exists")

def test_print_cow(self):
Expand All @@ -90,6 +89,21 @@ def test_alectodb_download(self):
"file alectodb-passwords.txt exists",
)

def test_improve_dictionary(self):

filename = "improveme.txt"
open(filename, "a").write("password123\n2018password\npassword\n")

__builtins__.input = lambda _: "Y" # Mock
improve_dictionary(filename)

def test_download_wordlist(self):
""" Download wordlists via menu """
__builtins__.input = lambda _: "31" # Mock
download_wordlist()
filename = "dictionaries/russian/russian.lst.gz"
self.assertTrue(os.path.isfile(filename), "file " + filename + "exists")


if __name__ == "__main__":
unittest.main()

0 comments on commit 8c7d11d

Please sign in to comment.