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)
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)
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)