Skip to content

Commit

Permalink
Adds mocking of gpx file using parameterized.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselmos authored and Anselmos committed Mar 29, 2017
1 parent 7996650 commit 9ec07b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 8 additions & 9 deletions bikingendorphines/web/tests.py
Expand Up @@ -3,6 +3,8 @@
"""
from django.test import TestCase

from parameterized import parameterized

from .models import User
from .utils import GPXReader

Expand All @@ -28,22 +30,19 @@ class GPXReaderTestCase(TestCase):
"""
Tests all GPXReader class cases for methods access.
"""

def setUp(self):

#pylint: disable=fixme
# TODO make mocking of example file!
self.gpxreader = GPXReader('bikingendorphines/example_data/15212277.gpx')

def test_get_points(self):
@parameterized.expand([
('bikingendorphines/example_data/15212277.gpx'),
])
def test_get_points(self, gpx_file):
"""
Tests if there will be data output from get_points.
Test if:
- points exists for different types.
- what will happen if types exists, but no data?
"""
gpxreader = GPXReader(gpx_file)
points = []
for point in self.gpxreader.get_points():
for point in gpxreader.get_points():
points.append(point)
self.assertGreater(len(points), 0)
2 changes: 2 additions & 0 deletions requirements.txt
Expand Up @@ -9,6 +9,8 @@ isort==4.2.5
lazy-object-proxy==1.2.2
mccabe==0.6.1
packaging==16.8
parameterized==0.6.1
py==1.4.33
pylint==1.6.5
pylint-django==0.7.2
pylint-plugin-utils==0.2.4
Expand Down

0 comments on commit 9ec07b0

Please sign in to comment.