diff --git a/ogn/utils.py b/ogn/utils.py index 8dc71f5..8d29f5f 100644 --- a/ogn/utils.py +++ b/ogn/utils.py @@ -41,7 +41,7 @@ def get_ddb(csvfile=None): device.competition = row[4] device.tracked = row[5] == 'Y' device.identified = row[6] == 'Y' - device.aircraft_type = row[7] + device.aircraft_type = int(row[7]) devices.append(device) diff --git a/tests/custom_ddb.txt b/tests/custom_ddb.txt index 0b99d06..78d5d5c 100644 --- a/tests/custom_ddb.txt +++ b/tests/custom_ddb.txt @@ -1,7 +1,7 @@ -#DEVICE_TYPE,DEVICE_ID,AIRCRAFT_MODEL,REGISTRATION,CN,TRACKED,IDENTIFIED -'F','DD4711','HK36 TTC','D-EULE','CU','Y','Y' -'F','DD0815','Ventus 2cxM','D-1234','','Y','N' -'F','DD1234','LS 8 18m','D-8654','12','N','Y' -'F','DD3141','Arcus T','OE-4321','','N','N' -'O','DEADBE','Baloon','OE-ABC','','Y','Y' -'I','999999','A380','G-XXXL','XXL','Y','Y' +#DEVICE_TYPE,DEVICE_ID,AIRCRAFT_MODEL,REGISTRATION,CN,TRACKED,IDENTIFIED,AIRCRAFT_TYPE +'F','DD4711','HK36 TTC','D-EULE','CU','Y','Y','1' +'F','DD0815','Ventus 2cxM','D-1234','','Y','N','1' +'F','DD1234','LS 8 18m','D-8654','12','N','Y','1' +'F','DD3141','Arcus T','OE-4321','','N','N','1' +'O','DEADBE','Baloon','OE-ABC','','Y','Y','11' +'I','999999','A380','G-XXXL','XXL','Y','Y','9' diff --git a/tests/test_utils.py b/tests/test_utils.py index afa313c..3c2636d 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2,7 +2,7 @@ import unittest import unittest.mock as mock from ogn.utils import get_ddb, get_trackable, get_country_code -from ogn.model import AddressOrigin +from ogn.model import AircraftType class TestStringMethods(unittest.TestCase): @@ -21,8 +21,7 @@ class TestStringMethods(unittest.TestCase): self.assertEqual(device.competition, 'CU') self.assertTrue(device.tracked) self.assertTrue(device.identified) - - self.assertEqual(device.address_origin, AddressOrigin.user_defined) + self.assertEqual(device.aircraft_type, AircraftType.glider_or_motor_glider) def test_get_trackable(self): devices = get_ddb('tests/custom_ddb.txt')