def test_extract_messages_ingore_theme_for_output(self): dist = Distribution(dict(name='foo', version='1.2')) dist.entry_points = ''' [mkdocs.themes] mkdocs = mkdocs.themes.mkdocs ''' cmd = babel.extract_messages(dist) cmd.initialize_options() cmd.theme = 'mkdocs' cmd.output_file = 'foo/bar/messages.pot' cmd.finalize_options() self.assertEqual(cmd.input_paths, [path.join(BASE_DIR, 'mkdocs', 'themes', 'mkdocs')]) self.assertEqual(cmd.output_file, 'foo/bar/messages.pot')
def test_extract_messages(self): dist = Distribution(dict(name='foo', version='1.2')) dist.entry_points = ''' [mkdocs.themes] mkdocs = mkdocs.themes.mkdocs ''' cmd = babel.extract_messages(dist) cmd.initialize_options() cmd.theme = 'mkdocs' cmd.finalize_options() self.assertEqual(cmd.input_paths, [path.join(BASE_DIR, 'mkdocs', 'themes', 'mkdocs')]) self.assertEqual( cmd.output_file, path.join(BASE_DIR, 'mkdocs', 'themes', 'mkdocs/messages.pot')) self.assertEqual(cmd.mapping_file, babel.DEFAULT_MAPPING_FILE) self.assertEqual(cmd.project, 'foo') self.assertEqual(cmd.version, '1.2')