def test_sensor_pair_construction(self): sensor_1 = Sensor('avhrr-n12', Period((2007, 1, 1), (2008, 1, 1))) sensor_2 = Sensor('avhrr-n13', Period((2007, 7, 1), (2008, 7, 1))) sensor_3 = Sensor('avhrr-n14', Period((2008, 1, 1), (2009, 1, 1))) sensor_pair = SensorPair(sensor_1, sensor_2) self.assertEqual('avhrr-n12', sensor_pair.get_primary_name()) self.assertEqual('avhrr-n13', sensor_pair.get_secondary_name()) self.assertEqual(Period((2007, 7, 1), (2008, 1, 1)), sensor_pair.get_period()) sensor_pair = SensorPair(sensor_3, sensor_2) self.assertEqual('avhrr-n14', sensor_pair.get_primary_name()) self.assertEqual('avhrr-n13', sensor_pair.get_secondary_name()) self.assertEqual(Period((2008, 1, 1), (2008, 7, 1)), sensor_pair.get_period())
def test_sensor_pair_get_secondary_name(self): sensor_1 = Sensor('avhrr-m01', Period((2007, 1, 1), (2008, 1, 1))) sensor_2 = Sensor('avhrr-m02', Period((2007, 7, 1), (2008, 7, 1))) sensor_pair = SensorPair(sensor_1, sensor_2) self.assertEqual('avhrr-m02', sensor_pair.get_secondary_name())