def repositoryIsUpToDate(location): result = True if isHgRepository(location): hg = which('hg') if len(hg) > 0: process = Popen([hg[0], "status", location], stdout=PIPE, stderr=PIPE) outputs = process.communicate() stdout = outputs[0] stderr = outputs[1] if len(stdout) > 0 or len(stderr) > 0: result = False return result
def testWhichNotExists(self): result = which('blahblah') self.assertEqual(0, len(result))