def testFileName(self): """fileName deduction on Windows must work with \\ too""" s = { 'scm': 'url', 'url': "C:/X/Y/my-pkg.zip", 'recipe': "foo.yaml#0", '__source': "Recipe foo", } self.assertEqual(UrlScm(s).getProperties()["fileName"], "my-pkg.zip") s["url"] = r"C:\X\Y\my-pkg.zip" self.assertEqual(UrlScm(s).getProperties()["fileName"], "my-pkg.zip")
def createUrlScm(self, spec={}): s = { 'scm': 'url', 'url': self.url, 'recipe': "foo.yaml#0", } s.update(spec) return UrlScm(s)