Beispiel #1
0
    def test_add_smp_preconditions_for_one_year(self):
        w = Workflow('test', Period('1991-01-01', '1992-01-01'))
        w.add_primary_sensor('avhrr.n10', (1986, 11, 17), (1991, 9, 16))
        w.add_primary_sensor('avhrr.n11', (1988, 11, 8), (1994, 12, 31))
        w.add_primary_sensor('avhrr.n12', (1991, 9, 16), (1998, 12, 14))
        w.add_secondary_sensor('avhrr.n10', (1986, 11, 17), (1991, 9, 16))
        w.add_secondary_sensor('avhrr.n11', (1988, 11, 8), (1994, 12, 31))
        w.add_secondary_sensor('avhrr.n12', (1991, 9, 16), (1998, 12, 14))

        preconditions = list()
        preconditions = w._add_smp_preconditions(preconditions)
        self.assertEqual(4, len(preconditions))
        self.assertEqual('/smp/avhrr.n12,avhrr.n11/1991/08', preconditions[0])
        self.assertEqual('/smp/avhrr.n12,avhrr.n11/1992/01', preconditions[1])
        self.assertEqual('/smp/avhrr.n11,avhrr.n10/1990/12', preconditions[2])
        self.assertEqual('/smp/avhrr.n11,avhrr.n10/1991/10', preconditions[3])
    def test_add_smp_preconditions_for_one_year(self):
        w = Workflow('test', Period('1991-01-01', '1992-01-01'))
        w.add_primary_sensor('avhrr.n10', (1986, 11, 17), (1991, 9, 16))
        w.add_primary_sensor('avhrr.n11', (1988, 11, 8), (1994, 12, 31))
        w.add_primary_sensor('avhrr.n12', (1991, 9, 16), (1998, 12, 14))
        w.add_secondary_sensor('avhrr.n10', (1986, 11, 17), (1991, 9, 16))
        w.add_secondary_sensor('avhrr.n11', (1988, 11, 8), (1994, 12, 31))
        w.add_secondary_sensor('avhrr.n12', (1991, 9, 16), (1998, 12, 14))

        preconditions = list()
        preconditions = w._add_smp_preconditions(preconditions)
        self.assertEqual(4, len(preconditions))
        self.assertEqual('/smp/avhrr.n12,avhrr.n11/1991/08', preconditions[0])
        self.assertEqual('/smp/avhrr.n12,avhrr.n11/1992/01', preconditions[1])
        self.assertEqual('/smp/avhrr.n11,avhrr.n10/1990/12', preconditions[2])
        self.assertEqual('/smp/avhrr.n11,avhrr.n10/1991/10', preconditions[3])