Ejemplo n.º 1
0
    def test_find_import_deps(self):
        """Test Pom._find_import_deps()"""
        client = self._mock_client(IMPORT_DEPS_1, FOO_PARENT_1_POM, FOO_PARENT_1_POM)
        pom = Pom("foo:bar:1", client)

        import_deps = list(pom._find_import_deps()["import"])
        assert import_deps[0] == (("foo", "parent", "1"), True)
Ejemplo n.º 2
0
 def test_replace_properties(self):
     """Test Pom._replace_properties"""
     client = self._mock_client(FOO_BAR_1_POM, FOO_PARENT_1_POM)
     pom = Pom("foo:bar:1", client)
     properties = {"prop1": "\na string\n", "prop2": "${prop1}"}
     assert "prop1" == pom._replace_properties("prop1", properties)
     assert "a string" == pom._replace_properties("${prop1}", properties)
     assert "a string" == pom._replace_properties("${prop2}", properties)
     assert "baz version string" == pom._replace_properties("${bazChild}")
     assert "baz version string" == pom._replace_properties("${bazVersion}")
     assert "${unmatched}" == pom._replace_properties("${unmatched}")
     assert "${parentProp}" == pom.parent._replace_properties("${parentProp}")
     assert "resolve" == pom._replace_properties("${resolveProp}")
     assert "resolve" == pom._replace_properties("${parentProp}")