Make sure the directories are inspected for source files bpo-31920
(self)
| 375 | self.assert_POT_equal(expected, output) |
| 376 | |
| 377 | def test_files_list(self): |
| 378 | """Make sure the directories are inspected for source files |
| 379 | bpo-31920 |
| 380 | """ |
| 381 | text1 = 'Text to translate1' |
| 382 | text2 = 'Text to translate2' |
| 383 | text3 = 'Text to ignore' |
| 384 | with temp_cwd(None), temp_dir(None) as sdir: |
| 385 | pymod = Path(sdir, 'pypkg', 'pymod.py') |
| 386 | pymod.parent.mkdir() |
| 387 | pymod.write_text(f'_({text1!r})', encoding='utf-8') |
| 388 | |
| 389 | pymod2 = Path(sdir, 'pkg.py', 'pymod2.py') |
| 390 | pymod2.parent.mkdir() |
| 391 | pymod2.write_text(f'_({text2!r})', encoding='utf-8') |
| 392 | |
| 393 | pymod3 = Path(sdir, 'CVS', 'pymod3.py') |
| 394 | pymod3.parent.mkdir() |
| 395 | pymod3.write_text(f'_({text3!r})', encoding='utf-8') |
| 396 | |
| 397 | assert_python_ok('-Xutf8', self.script, sdir) |
| 398 | data = Path('messages.pot').read_text(encoding='utf-8') |
| 399 | self.assertIn(f'msgid "{text1}"', data) |
| 400 | self.assertIn(f'msgid "{text2}"', data) |
| 401 | self.assertNotIn(text3, data) |
| 402 | |
| 403 | |
| 404 | def extract_from_snapshots(): |
nothing calls this directly
no test coverage detected