Exemple #1
0
    def test_add_get_secondary_sensors_multiple(self):
        w = Workflow('test', 9)
        w.add_secondary_sensor('atsr-e2', '1996-06-01', '1997-01-01')
        w.add_secondary_sensor('atsr-e1', '1992-06-01', '1996-01-01')
        w.add_secondary_sensor('atsr-en', '1997-01-01', '1999-01-01')

        sensors = w._get_secondary_sensors()
        self.assertEqual([Sensor('atsr-en', Period((1997, 1, 1), (1999, 1, 1))),
                          Sensor('atsr-e2', Period((1996, 6, 1), (1997, 1, 1))),
                          Sensor('atsr-e1', Period((1992, 6, 1), (1996, 1, 1)))], sensors)
    def test_add_secondary_sensors_to_workflow(self):
        w = Workflow('test')
        w.add_secondary_sensor('avhrr.n10', (2007, 1, 1), (2008, 1, 1))
        self.assertEqual(1, len(w._get_secondary_sensors()))

        try:
            w.add_secondary_sensor('avhrr.n10', (2007, 1, 1), (2008, 1, 1))
            self.fail()
        except exceptions.ValueError:
            pass

        try:
            w.add_secondary_sensor('avhrr.n10', (2007, 7, 1), (2008, 1, 1))
            self.fail()
        except exceptions.ValueError:
            pass

        w.add_secondary_sensor('avhrr.n11', (2007, 1, 1), (2008, 1, 1))
        self.assertEqual(2, len(w._get_secondary_sensors()))
        w.add_secondary_sensor('avhrr.n12', (2008, 1, 1), (2009, 1, 1))
        self.assertEqual(3, len(w._get_secondary_sensors()))
Exemple #3
0
    def test_add_get_secondary_sensors_multiple(self):
        w = Workflow('test', 9)
        w.add_secondary_sensor('atsr-e2', '1996-06-01', '1997-01-01')
        w.add_secondary_sensor('atsr-e1', '1992-06-01', '1996-01-01')
        w.add_secondary_sensor('atsr-en', '1997-01-01', '1999-01-01')

        sensors = w._get_secondary_sensors()
        self.assertEqual([
            Sensor('atsr-en', Period((1997, 1, 1), (1999, 1, 1))),
            Sensor('atsr-e2', Period((1996, 6, 1), (1997, 1, 1))),
            Sensor('atsr-e1', Period((1992, 6, 1), (1996, 1, 1)))
        ], sensors)
    def test_add_secondary_sensors_to_workflow(self):
        w = Workflow('test')
        w.add_secondary_sensor('avhrr.n10', (2007, 1, 1), (2008, 1, 1))
        self.assertEqual(1, len(w._get_secondary_sensors()))

        try:
            w.add_secondary_sensor('avhrr.n10', (2007, 1, 1), (2008, 1, 1))
            self.fail()
        except exceptions.ValueError:
            pass

        try:
            w.add_secondary_sensor('avhrr.n10', (2007, 7, 1), (2008, 1, 1))
            self.fail()
        except exceptions.ValueError:
            pass

        w.add_secondary_sensor('avhrr.n11', (2007, 1, 1), (2008, 1, 1))
        self.assertEqual(2, len(w._get_secondary_sensors()))
        w.add_secondary_sensor('avhrr.n12', (2008, 1, 1), (2009, 1, 1))
        self.assertEqual(3, len(w._get_secondary_sensors()))
Exemple #5
0
 def test_add_get_secondary_sensors_version(self):
     w = Workflow('test', 8)
     w.add_secondary_sensor('avhrr-n16', '1995-06-01', '1996-01-01', 'v_3')
     self.assertEqual(
         [Sensor('avhrr-n16', Period((1995, 6, 1), (1996, 1, 1)), 'v_3')],
         w._get_secondary_sensors())
Exemple #6
0
 def test_get_secondary_sensors_empty_list(self):
     w = Workflow('test', 7)
     self.assertEqual([], w._get_secondary_sensors())
Exemple #7
0
 def test_add_get_secondary_sensors_version(self):
     w = Workflow('test', 8)
     w.add_secondary_sensor('avhrr-n16', '1995-06-01', '1996-01-01', 'v_3')
     self.assertEqual([Sensor('avhrr-n16', Period((1995, 6, 1), (1996, 1, 1)), 'v_3')], w._get_secondary_sensors())
Exemple #8
0
 def test_get_secondary_sensors_empty_list(self):
     w = Workflow('test', 7)
     self.assertEqual([], w._get_secondary_sensors())