Skip to content

Commit 4fd4791

Browse files
committed
Added more tests for prefix and suffix
1 parent 484e21d commit 4fd4791

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/helpers/test_wordlist_helper.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,22 @@ def test_words_with_suffix(self):
7777
wordlist, wordlist_types = self.wordlist.get_wordlist(None,None,suffix)
7878
self.assertEqual(wordlist, expected_wordlist)
7979

80+
def test_words_with_host_and_prefix(self):
81+
stdin_wordlist = ['www.%s']
82+
expected_wordlist = stdin_wordlist + ['test-www.%s']
83+
prefix = 'test-'
84+
with patch('lib.helpers.wordlist_helper.WordList.get_stdin_wordlist', return_value=stdin_wordlist):
85+
wordlist, wordlist_types = self.wordlist.get_wordlist(None, prefix)
86+
self.assertEqual(wordlist, expected_wordlist)
87+
88+
def test_words_with_host_and_suffix(self):
89+
stdin_wordlist = ['www.%s']
90+
expected_wordlist = stdin_wordlist + ['wwwtest.%s']
91+
suffix = 'test'
92+
with patch('lib.helpers.wordlist_helper.WordList.get_stdin_wordlist', return_value=stdin_wordlist):
93+
wordlist, wordlist_types = self.wordlist.get_wordlist(None,None,suffix)
94+
self.assertEqual(wordlist, expected_wordlist)
95+
96+
97+
8098

0 commit comments

Comments
 (0)