我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用distutils.dep_util.newer_pairwise()。
def test_newer_pairwise(self): tmpdir = self.mkdtemp() sources = os.path.join(tmpdir, 'sources') targets = os.path.join(tmpdir, 'targets') os.mkdir(sources) os.mkdir(targets) one = os.path.join(sources, 'one') two = os.path.join(sources, 'two') three = os.path.abspath(__file__) # I am the old file four = os.path.join(targets, 'four') self.write_file(one) self.write_file(two) self.write_file(four) self.assertEqual(newer_pairwise([one, two], [three, four]), ([one],[three]))