def test_get_inp_preconditions_for_one_month_minus_one_day(self): w = Workflow('test', Period('1991-01-02', '1991-02-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 = [] preconditions = w._add_inp_preconditions(preconditions) self.assertEqual(1, len(preconditions)) self.assertEqual('/inp/1991/01', preconditions[0])
def test_get_inp_preconditions_for_all_years(self): w = Workflow('test') 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 = [] preconditions = w._add_inp_preconditions(preconditions) self.assertEqual(74, len(preconditions)) self.assertEqual('/inp/1988/11', preconditions[0]) self.assertEqual('/inp/1994/12', preconditions[73])