Beispiel #1
0
    def test_is_older3(self):
        """ compare a dependency group to a singular dependency """
        dep1a = Dataset(fullpath("testdata/1a"))
        dep1b = Dataset(fullpath("testdata/1b"))
        dep1c = Dataset(fullpath("testdata/1c"))

        group1 = DatasetGroup(fullpath("testdata/1"), [dep1a, dep1b, dep1c])

        for dep in group1:
            makefile(dep.name)
        time.sleep(0.05)

        dep2 = Dataset(fullpath("testdata/2"))
        makefile(dep2.name)

        self.assertTrue(depgraph.is_older(group1, dep2))
Beispiel #2
0
    def test_is_older2(self):
        """ define two dependency groups, where files ages overlap, and so
        group 1 is not absolutely older than group 2 """
        dep1a = Dataset(fullpath("testdata/1a"))
        dep1b = Dataset(fullpath("testdata/1b"))
        dep2c = Dataset(fullpath("testdata/2c"))

        for dep in (dep1a, dep1b, dep2c):
            makefile(dep.name)
        time.sleep(0.05)

        dep1c = Dataset(fullpath("testdata/1c"))
        dep2a = Dataset(fullpath("testdata/2a"))
        dep2b = Dataset(fullpath("testdata/2b"))

        for dep in (dep1c, dep2a, dep2b):
            makefile(dep.name)

        group1 = DatasetGroup(fullpath("testdata/1"), [dep1a, dep1b, dep1c])
        group2 = DatasetGroup(fullpath("testdata/2"), [dep2a, dep2b, dep2c])

        self.assertFalse(depgraph.is_older(group1, group2))
Beispiel #3
0
    def test_is_older1(self):
        """ define two dependency groups, where all files are older in one
        than in the other. """
        dep1a = Dataset(fullpath("testdata/1a"))
        dep1b = Dataset(fullpath("testdata/1b"))
        dep1c = Dataset(fullpath("testdata/1c"))

        for dep in (dep1a, dep1b, dep1c):
            makefile(dep.name)
        time.sleep(0.05)

        dep2a = Dataset(fullpath("testdata/2a"))
        dep2b = Dataset(fullpath("testdata/2b"))
        dep2c = Dataset(fullpath("testdata/2c"))

        for dep in (dep2a, dep2b, dep2c):
            makefile(dep.name)

        group1 = DatasetGroup(fullpath("testdata/1"), [dep1a, dep1b, dep1c])
        group2 = DatasetGroup(fullpath("testdata/2"), [dep2a, dep2b, dep2c])

        self.assertTrue(depgraph.is_older(group1, group2))