def get_optional_versions(): """Return versions of optional modules.""" result = [] for name in OPTIONAL: module = get_version_module(name, True) if module is not None: result.append(module) if HgRepository.is_supported(): result.append(("Mercurial", "https://www.mercurial-scm.org/", HgRepository.get_version())) if SubversionRepository.is_supported(): result.append(( "git-svn", "https://git-scm.com/docs/git-svn", SubversionRepository.get_version(), )) if GitWithGerritRepository.is_supported(): result.append(( "git-review", "https://pypi.org/project/git-review/", GitWithGerritRepository.get_version(), )) return result
def get_optional_versions(): """Return versions of optional modules.""" result = [] get_optional_module( result, 'pytz', 'pytz', 'https://pypi.org/project/pytz/' ) get_optional_module( result, 'pyuca', 'pyuca', 'https://github.com/jtauber/pyuca' ) get_optional_module( result, 'bidi', 'python-bidi', 'https://github.com/MeirKriheli/python-bidi' ) get_optional_module( result, 'yaml', 'PyYAML', 'https://pyyaml.org/wiki/PyYAML' ) get_optional_module( result, 'tesserocr', 'tesserocr', 'https://github.com/sirfz/tesserocr' ) if HgRepository.is_supported(): result.append(( 'Mercurial', 'https://www.mercurial-scm.org/', HgRepository.get_version(), '2.8', )) if SubversionRepository.is_supported(): result.append(( 'git-svn', 'https://git-scm.com/docs/git-svn', SubversionRepository.get_version(), '1.6', )) if GitWithGerritRepository.is_supported(): result.append(( 'git-review', 'https://pypi.org/project/git-review/', GitWithGerritRepository.get_version(), '1.0', )) if GithubRepository.is_supported(): result.append(( 'hub', 'https://hub.github.com/', GithubRepository.get_version(), '1.0', )) return result
def get_optional_versions(): """Return versions of optional modules.""" result = [] get_optional_module( result, 'ruamel.yaml', 'https://pypi.org/project/ruamel.yaml/' ) get_optional_module( result, 'tesserocr', 'https://github.com/sirfz/tesserocr' ) if HgRepository.is_supported(): result.append(( 'Mercurial', 'https://www.mercurial-scm.org/', HgRepository.get_version(), '2.8', )) if SubversionRepository.is_supported(): result.append(( 'git-svn', 'https://git-scm.com/docs/git-svn', SubversionRepository.get_version(), '1.6', )) if GitWithGerritRepository.is_supported(): result.append(( 'git-review', 'https://pypi.org/project/git-review/', GitWithGerritRepository.get_version(), '1.0', )) if GithubRepository.is_supported(): result.append(( 'hub', 'https://hub.github.com/', GithubRepository.get_version(), '1.0', )) return result
def test_import_mercurial_mixed(self): """Test importing Mercurial project with mixed component/lang""" if not HgRepository.is_supported(): raise SkipTest('Mercurial not available!') self.create_project() with self.assertRaises(CommandError): call_command('import_project', 'test', self.mercurial_repo_path, 'default', '*/**.po', vcs='mercurial')
def test_import_mercurial(self): """Test importing Mercurial project""" if not HgRepository.is_supported(): raise SkipTest('Mercurial not available!') project = self.create_project() call_command('import_project', 'test', self.mercurial_repo_path, 'default', '**/*.po', vcs='mercurial') self.assertEqual(project.component_set.count(), 3)
def test_import_mercurial_mixed(self): """Test importing Mercurial project with mixed component/lang.""" if not HgRepository.is_supported(): raise SkipTest("Mercurial not available!") self.create_project() with self.assertRaises(CommandError): call_command( "import_project", "test", self.mercurial_repo_path, "default", "*/**.po", vcs="mercurial", )
def test_import_mercurial(self): """Test importing Mercurial project.""" if not HgRepository.is_supported(): raise SkipTest("Mercurial not available!") project = self.create_project() call_command( "import_project", "test", self.mercurial_repo_path, "default", "**/*.po", vcs="mercurial", ) self.assertEqual(project.component_set.count(), 4)
def test_import_mercurial_mixed(self): """Test importing Mercurial project with mixed component/lang""" if not HgRepository.is_supported(): raise SkipTest('Mercurial not available!') self.create_project() with self.assertRaises(CommandError): call_command( 'import_project', 'test', self.mercurial_repo_path, 'default', '*/**.po', vcs='mercurial' )
def test_import_mercurial(self): """Test importing Mercurial project""" if not HgRepository.is_supported(): raise SkipTest('Mercurial not available!') project = self.create_project() call_command( 'import_project', 'test', self.mercurial_repo_path, 'default', '**/*.po', vcs='mercurial' ) self.assertEqual(project.component_set.count(), 3)