From 825765fd26dde71b5b0b958b04300083aca37d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Gru=CC=88ndger?= Date: Tue, 3 Oct 2017 12:49:36 +0200 Subject: [PATCH] Fixed test (relative paths) --- tests/test_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 3c2636d..2119a68 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,8 +1,9 @@ +import os import unittest -import unittest.mock as mock -from ogn.utils import get_ddb, get_trackable, get_country_code from ogn.model import AircraftType +from ogn.utils import get_ddb, get_trackable, get_country_code +import unittest.mock as mock class TestStringMethods(unittest.TestCase): @@ -11,7 +12,7 @@ class TestStringMethods(unittest.TestCase): self.assertGreater(len(devices), 1000) def test_get_ddb_from_file(self): - devices = get_ddb('tests/custom_ddb.txt') + devices = get_ddb(os.path.dirname(__file__) + '/custom_ddb.txt') self.assertEqual(len(devices), 6) device = devices[0] @@ -24,7 +25,7 @@ class TestStringMethods(unittest.TestCase): self.assertEqual(device.aircraft_type, AircraftType.glider_or_motor_glider) def test_get_trackable(self): - devices = get_ddb('tests/custom_ddb.txt') + devices = get_ddb(os.path.dirname(__file__) + '/custom_ddb.txt') trackable = get_trackable(devices) self.assertEqual(len(trackable), 4) self.assertIn('FLRDD4711', trackable)