Ejemplo n.º 1
0
 def processHashEngine(self, scm, expected):
     with tempfile.TemporaryDirectory() as workspace:
         subprocess.check_call(['/bin/bash', '-c', scm.asScript()],
             universal_newlines=True, stderr=subprocess.STDOUT, cwd=workspace)
         spec = scm.getLiveBuildIdSpec(workspace)
         if spec.startswith('='):
             self.assertEqual(bytes.fromhex(spec[1:]), expected)
         else:
             self.assertTrue(spec.startswith('g'))
             self.assertEqual(bytes.fromhex(GitScm.processLiveBuildIdSpec(spec[1:])),
                 expected)
Ejemplo n.º 2
0
 def processHashEngine(self, scm, expected):
     with tempfile.TemporaryDirectory() as workspace:
         self.invokeGit(workspace, scm)
         spec = scm.getLiveBuildIdSpec(workspace)
         if spec.startswith('='):
             self.assertEqual(bytes.fromhex(spec[1:]), expected)
         else:
             self.assertTrue(spec.startswith('g'))
             self.assertEqual(
                 bytes.fromhex(GitScm.processLiveBuildIdSpec(spec[1:])),
                 expected)
Ejemplo n.º 3
0
 def processHashEngine(self, scm, expected):
     with tempfile.TemporaryDirectory() as workspace:
         subprocess.check_call(['/bin/bash', '-c', scm.asScript()],
             universal_newlines=True, stderr=subprocess.STDOUT, cwd=workspace)
         spec = scm.getLiveBuildIdSpec(workspace)
         if spec.startswith('='):
             self.assertEqual(bytes.fromhex(spec[1:]), expected)
         else:
             self.assertTrue(spec.startswith('g'))
             self.assertEqual(bytes.fromhex(GitScm.processLiveBuildIdSpec(spec[1:])),
                 expected)