Skip to content

Commit a22b688

Browse files
Tomas's suggestions
1 parent 715e88e commit a22b688

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Lib/test/test_gettext.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -756,16 +756,18 @@ def test_find_with_lanuages(self):
756756
languages=['ga_IE'])
757757
self.assertEqual(result, mo_file)
758758

759-
def test_find_with_no_lang(self):
759+
@unittest.mock.patch('gettext._expand_lang')
760+
def test_find_with_no_lang(self, patch_expand_lang):
760761
# no language can be found
761-
result = gettext.find('foo')
762-
self.assertEqual(result, None)
762+
gettext.find('foo')
763+
patch_expand_lang.assert_called_with('C')
763764

764-
def test_find_with_c(self):
765+
@unittest.mock.patch('gettext._expand_lang')
766+
def test_find_with_c(self, patch_expand_lang):
765767
# 'C' is already in languages
766768
self.env.set('LANGUAGE', 'C')
767-
result = gettext.find('foo')
768-
self.assertEqual(result, None)
769+
gettext.find('foo')
770+
patch_expand_lang.assert_called_with('C')
769771

770772
def test_find_all(self):
771773
# test that all are returned when all is set

0 commit comments

Comments
 (0)