def test_verify_path_regexp_exists(self): with mock.patch('cq_cfg_presubmit.os.path.exists') as exists: exists.side_effect = [True] self.assertTrue( cq_cfg_presubmit.verify_path_regexps([ 'simple/file', ]))
def test_verify_path_regexp_os_walk_not_found(self): with mock.patch('cq_cfg_presubmit.os.walk') as walk: walk.side_effect = [(( os.path.join(cq_cfg_presubmit.CHROMIUM_DIR, 'random'), None, ['test.txt'], ), )] with mock.patch('cq_cfg_presubmit.os.path.exists') as exists: exists.side_effect = [False] self.assertFalse( cq_cfg_presubmit.verify_path_regexps([ 'simple/file/.+', ], False))