mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	gh-107510: gettext: Remove unnecessary tests (GH-127965)
There are now separate pygettext tests.
This commit is contained in:
		
							parent
							
								
									9d1e668e6f
								
							
						
					
					
						commit
						0f20281fa2
					
				
					 1 changed files with 0 additions and 50 deletions
				
			
		| 
						 | 
					@ -10,8 +10,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# TODO:
 | 
					# TODO:
 | 
				
			||||||
#  - Add new tests, for example for "dgettext"
 | 
					#  - Add new tests, for example for "dgettext"
 | 
				
			||||||
#  - Remove dummy tests, for example testing for single and double quotes
 | 
					 | 
				
			||||||
#    has no sense, it would have if we were testing a parser (i.e. pygettext)
 | 
					 | 
				
			||||||
#  - Tests should have only one assert.
 | 
					#  - Tests should have only one assert.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GNU_MO_DATA = b'''\
 | 
					GNU_MO_DATA = b'''\
 | 
				
			||||||
| 
						 | 
					@ -175,30 +173,6 @@ def test_some_translations_with_context(self):
 | 
				
			||||||
        eq(pgettext('my other context', 'nudge nudge'),
 | 
					        eq(pgettext('my other context', 'nudge nudge'),
 | 
				
			||||||
           'wink wink (in "my other context")')
 | 
					           'wink wink (in "my other context")')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_double_quotes(self):
 | 
					 | 
				
			||||||
        eq = self.assertEqual
 | 
					 | 
				
			||||||
        # double quotes
 | 
					 | 
				
			||||||
        eq(_("albatross"), 'albatross')
 | 
					 | 
				
			||||||
        eq(_("mullusk"), 'bacon')
 | 
					 | 
				
			||||||
        eq(_(r"Raymond Luxury Yach-t"), 'Throatwobbler Mangrove')
 | 
					 | 
				
			||||||
        eq(_(r"nudge nudge"), 'wink wink')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_triple_single_quotes(self):
 | 
					 | 
				
			||||||
        eq = self.assertEqual
 | 
					 | 
				
			||||||
        # triple single quotes
 | 
					 | 
				
			||||||
        eq(_('''albatross'''), 'albatross')
 | 
					 | 
				
			||||||
        eq(_('''mullusk'''), 'bacon')
 | 
					 | 
				
			||||||
        eq(_(r'''Raymond Luxury Yach-t'''), 'Throatwobbler Mangrove')
 | 
					 | 
				
			||||||
        eq(_(r'''nudge nudge'''), 'wink wink')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_triple_double_quotes(self):
 | 
					 | 
				
			||||||
        eq = self.assertEqual
 | 
					 | 
				
			||||||
        # triple double quotes
 | 
					 | 
				
			||||||
        eq(_("""albatross"""), 'albatross')
 | 
					 | 
				
			||||||
        eq(_("""mullusk"""), 'bacon')
 | 
					 | 
				
			||||||
        eq(_(r"""Raymond Luxury Yach-t"""), 'Throatwobbler Mangrove')
 | 
					 | 
				
			||||||
        eq(_(r"""nudge nudge"""), 'wink wink')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_multiline_strings(self):
 | 
					    def test_multiline_strings(self):
 | 
				
			||||||
        eq = self.assertEqual
 | 
					        eq = self.assertEqual
 | 
				
			||||||
        # multiline strings
 | 
					        # multiline strings
 | 
				
			||||||
| 
						 | 
					@ -285,30 +259,6 @@ def test_some_translations_with_context_and_domain(self):
 | 
				
			||||||
        eq(gettext.dpgettext('gettext', 'my other context', 'nudge nudge'),
 | 
					        eq(gettext.dpgettext('gettext', 'my other context', 'nudge nudge'),
 | 
				
			||||||
           'wink wink (in "my other context")')
 | 
					           'wink wink (in "my other context")')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_double_quotes(self):
 | 
					 | 
				
			||||||
        eq = self.assertEqual
 | 
					 | 
				
			||||||
        # double quotes
 | 
					 | 
				
			||||||
        eq(self._("albatross"), 'albatross')
 | 
					 | 
				
			||||||
        eq(self._("mullusk"), 'bacon')
 | 
					 | 
				
			||||||
        eq(self._(r"Raymond Luxury Yach-t"), 'Throatwobbler Mangrove')
 | 
					 | 
				
			||||||
        eq(self._(r"nudge nudge"), 'wink wink')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_triple_single_quotes(self):
 | 
					 | 
				
			||||||
        eq = self.assertEqual
 | 
					 | 
				
			||||||
        # triple single quotes
 | 
					 | 
				
			||||||
        eq(self._('''albatross'''), 'albatross')
 | 
					 | 
				
			||||||
        eq(self._('''mullusk'''), 'bacon')
 | 
					 | 
				
			||||||
        eq(self._(r'''Raymond Luxury Yach-t'''), 'Throatwobbler Mangrove')
 | 
					 | 
				
			||||||
        eq(self._(r'''nudge nudge'''), 'wink wink')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_triple_double_quotes(self):
 | 
					 | 
				
			||||||
        eq = self.assertEqual
 | 
					 | 
				
			||||||
        # triple double quotes
 | 
					 | 
				
			||||||
        eq(self._("""albatross"""), 'albatross')
 | 
					 | 
				
			||||||
        eq(self._("""mullusk"""), 'bacon')
 | 
					 | 
				
			||||||
        eq(self._(r"""Raymond Luxury Yach-t"""), 'Throatwobbler Mangrove')
 | 
					 | 
				
			||||||
        eq(self._(r"""nudge nudge"""), 'wink wink')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_multiline_strings(self):
 | 
					    def test_multiline_strings(self):
 | 
				
			||||||
        eq = self.assertEqual
 | 
					        eq = self.assertEqual
 | 
				
			||||||
        # multiline strings
 | 
					        # multiline strings
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue