def test_getScriptInfo(self): sName, md5 = self.createScript() info = hooks._getScriptInfo(sName) os.unlink(sName) self.assertEqual({'md5': md5}, info)
def test_getNEScriptInfo(self): path = '/tmp/nonExistent' info = hooks._getScriptInfo(path) self.assertEqual({'md5': ''}, info)
def test_get_script_info_should_return_checksum(hooks_dir, expected): path = str(hooks_dir.join("script.sh")) assert hooks._getScriptInfo(path) == {"md5": expected}