Beispiel #1
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}")