def test_get_rpm_str_compat(self): s = get_rpm_str("g", "a", compat_ver="1.0") self.assertEqual("mvn(g:a:1.0)", s) s = get_rpm_str("g", "a", compat_ver="1-SNAPSHOT") self.assertEqual("mvn(g:a:1-SNAPSHOT)", s) s = get_rpm_str("g", "a", ext="zip", compat_ver="1.0") self.assertEqual("mvn(g:a:zip:1.0)", s)
def test_get_rpm_str_versioned(self): s = get_rpm_str("g", "a", pkg_ver="1.0") self.assertEqual("mvn(g:a) = 1.0", s) s = get_rpm_str("g", "a", pkg_ver="1-SNAPSHOT") self.assertEqual("mvn(g:a) = 1.SNAPSHOT", s) s = get_rpm_str("g", "a", ext="zip", pkg_ver="1.0") self.assertEqual("mvn(g:a:zip:) = 1.0", s)
def test_get_rpm_str_basic(self): s = get_rpm_str("g", "a") self.assertEqual("mvn(g:a)", s) s = get_rpm_str("g", "a", ext="jar") self.assertEqual("mvn(g:a)", s) s = get_rpm_str("g", "a", ext="hpi") self.assertEqual("mvn(g:a:hpi:)", s) s = get_rpm_str("g", "a", cla="test") self.assertEqual("mvn(g:a::test:)", s)
def get_rpm_str(self, namespace=None, compat_ver=None, pkg_ver=None): return Printer.get_rpm_str(self.groupId, self.artifactId, ext=self.extension, cla=self.classifier, namespace=namespace or self.namespace, compat_ver=compat_ver or self.resolvedVersion, pkg_ver=pkg_ver)
def get_rpm_str(self, namespace=None, pkg_ver=None): result = [] if not self.is_compat(): # non-compat rpm string for main artifact result.append( Printer.get_rpm_str(self.groupId, self.artifactId, ext=self.extension, cla=self.classifier, namespace=namespace, pkg_ver=pkg_ver)) # non-compat rpm string(s) for aliases for alias in self.aliases: result.append( Printer.get_rpm_str(alias.groupId, alias.artifactId, ext=alias.extension, cla=alias.classifier, namespace=namespace, pkg_ver=pkg_ver)) else: # compat rpm string(s) for main artifact for compat_ver in self.compatVersions: result.append( Printer.get_rpm_str(self.groupId, self.artifactId, ext=self.extension, cla=self.classifier, compat_ver=compat_ver, namespace=namespace, pkg_ver=pkg_ver)) # compat rpm string(s) for aliases for alias in self.aliases: result.append( Printer.get_rpm_str(alias.groupId, alias.artifactId, ext=alias.extension, cla=alias.classifier, compat_ver=compat_ver, namespace=namespace, pkg_ver=pkg_ver)) return "\n".join(result)
def get_rpm_str(self, namespace=None, compat_ver=None, pkg_ver=None): m = self.__get_members() return Printer.get_rpm_str(m['groupId'], m['artifactId'], ext=m['extension'], cla=m['classifier'], namespace=namespace, compat_ver=compat_ver, pkg_ver=pkg_ver)
def get_rpm_str(self, namespace=None, pkg_ver=None): result = [] if not self.is_compat(): # non-compat rpm string for main artifact result.append(Printer.get_rpm_str(self.groupId, self.artifactId, ext=self.extension, cla=self.classifier, namespace=namespace, pkg_ver=pkg_ver)) # non-compat rpm string(s) for aliases for alias in self.aliases: result.append(Printer.get_rpm_str(alias.groupId, alias.artifactId, ext=alias.extension, cla=alias.classifier, namespace=namespace, pkg_ver=pkg_ver)) else: # compat rpm string(s) for main artifact for compat_ver in self.compatVersions: result.append(Printer.get_rpm_str(self.groupId, self.artifactId, ext=self.extension, cla=self.classifier, compat_ver=compat_ver, namespace=namespace, pkg_ver=pkg_ver)) # compat rpm string(s) for aliases for alias in self.aliases: result.append(Printer.get_rpm_str(alias.groupId, alias.artifactId, ext=alias.extension, cla=alias.classifier, compat_ver=compat_ver, namespace=namespace, pkg_ver=pkg_ver)) return "\n".join(result)
def test_get_rpm_str_namespace(self): s = get_rpm_str("g", "a", namespace="ns1") self.assertEqual("ns1-mvn(g:a)", s)