Return all msgids extracted from module_content.
(self, module_content, *, args=(), strict=True,
with_stderr=False, raw=False)
| 93 | self.assertEqual(normalize_POT_file(expected), normalize_POT_file(actual)) |
| 94 | |
| 95 | def extract_from_str(self, module_content, *, args=(), strict=True, |
| 96 | with_stderr=False, raw=False): |
| 97 | """Return all msgids extracted from module_content.""" |
| 98 | filename = 'test.py' |
| 99 | with temp_cwd(None): |
| 100 | with open(filename, 'w', encoding='utf-8') as fp: |
| 101 | fp.write(module_content) |
| 102 | res = assert_python_ok('-Xutf8', self.script, *args, filename) |
| 103 | if strict: |
| 104 | self.assertEqual(res.err, b'') |
| 105 | with open('messages.pot', encoding='utf-8') as fp: |
| 106 | data = fp.read() |
| 107 | if not raw: |
| 108 | data = self.get_msgids(data) |
| 109 | if not with_stderr: |
| 110 | return data |
| 111 | return data, res.err |
| 112 | |
| 113 | def extract_docstrings_from_str(self, module_content): |
| 114 | """Return all docstrings extracted from module_content.""" |
no test coverage detected