Skip to content

Commit 8194fd8

Browse files
committed
test_find upgrade
Updated test_find.py to check if type work with -name and with -regex
1 parent c9f5c54 commit 8194fd8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test_find.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,24 @@ def test_find_dirs_files_with_regex(self):
120120

121121
self.assertEqual(actual_output.getvalue(), theoretical_output.getvalue())
122122

123-
def test_type_works_with_name_specified(self):
123+
def test_type_works_with_regex_specified(self):
124124
global tmp_dir
125125
actual_output = find.do_search(tmp_dir, 'a', None, 'f')
126126

127-
theorectical_output = io.StringIO()
127+
theoretical_output = io.StringIO()
128128
print(os.path.join(tmp_dir, 'abc123.txt'), file=theoretical_output)
129129

130130
self.assertEqual(actual_output.getvalue(), theoretical_output.getvalue())
131131

132+
def test_type_works_with_name_specified(self):
133+
global tmp_dir
134+
actual_output = find.do_search(tmp_dir, None, 'a', 'd')
135+
136+
theoretical_output = io.StringIO()
137+
print(os.path.join(tmp_dir, 'a'), file=theoretical_output)
138+
139+
self.assertEqual(actual_output.getvalue(), theoretical_output.getvalue())
140+
132141

133142
def tearDown(self):
134143
global tmp_dir_previously_existed

0 commit comments

Comments
 (0)