Exemplo n.º 1
0
 def testCopyNoDirectory(self):
     """Test that source must be a directory"""
     s = self.createImportScm({"url": self.fn})
     with tempfile.TemporaryDirectory() as workspace:
         with self.assertRaises(InvocationError):
             self.invokeScm(workspace, s)
         with self.assertRaises(BuildError):
             self.invokeScm(workspace, ImportScm(s.getProperties()))
Exemplo n.º 2
0
 def createImportScm(self, spec={}):
     s = {
         'scm': 'import',
         'url': self.url,
         'recipe': "foo.yaml#0",
         '__source': "Recipe foo",
     }
     s.update(spec)
     return ImportScm(s)
Exemplo n.º 3
0
 def testCopyViaProperties(self):
     """Test Jenkins-like 'checkout' via properties"""
     s = ImportScm(self.createImportScm().getProperties())
     with tempfile.TemporaryDirectory() as workspace:
         self.invokeScm(workspace, s)
         self.assertEqual(self.digest, hashDirectory(workspace))