forked from alenrajsp/tcxreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
907f386
commit 1c5588f
Showing
6 changed files
with
46 additions
and
37 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import logging | ||
|
||
def pytest_configure(config): | ||
r"""Disable verbose output when running tests.""" | ||
logging.basicConfig(level=logging.DEBUG) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
from unittest import TestCase | ||
from tcxreader.tcxreader import TCXReader, TCXTrackPoint, TCXExercise | ||
|
||
|
||
class TestTCXReader(TestCase): | ||
def setUp(self): | ||
filename = os.path.join(os.path.dirname(__file__), "data", '15.tcx') | ||
self.tcx = TCXReader().read(filename) | ||
|
||
def test_distance(self): | ||
self.assertEqual(self.tcx.distance, 116366.98) | ||
|
||
def test_duration(self): | ||
self.assertEqual(self.tcx.duration, 17250.0) | ||
|
||
def test_calories(self): | ||
self.assertEqual(self.tcx.calories, 2010) | ||
|
||
def test_hr_avg(self): | ||
self.assertEqual(int(self.tcx.hr_avg), 140) | ||
|
||
def test_hr_max(self): | ||
self.assertEqual(self.tcx.hr_max, None) | ||
|
||
def test_hr_min(self): | ||
self.assertEqual(self.tcx.hr_min, 94) | ||
|
||
def altitude_avg(self): | ||
self.assertEqual(self.tcx.altitude_avg, None) | ||
|
||
def test_altitude_min(self): | ||
self.assertAlmostEqual(self.tcx.altitude_min, -5.4, places=1) | ||
|
||
def test_ascent(self): | ||
self.assertAlmostEqual(self.tcx.ascent, 1404.4, places=1) | ||
|
||
def test_descent(self): | ||
self.assertAlmostEqual(self.tcx.descent, 1422.0, places=1) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,4 @@ | ||
import os | ||
from unittest import TestCase | ||
from tcxreader.tcxreader import TCXReader, TCXTrackPoint, TCXExercise | ||
from tcxreader.tests.conftest import pytest_configure | ||
|
||
__all__ = ["pytest_configure"] | ||
|
||
class TestTCXReader(TestCase): | ||
def setUp(self): | ||
filename = os.path.join(os.path.dirname(__file__), "data", '15.tcx') | ||
self.tcx = TCXReader().read(filename) | ||
|
||
def test_distance(self): | ||
self.assertEqual(self.tcx.distance, 116366.98) | ||
|
||
def test_duration(self): | ||
self.assertEqual(self.tcx.duration, 17250.0) | ||
|
||
def test_calories(self): | ||
self.assertEqual(self.tcx.calories, 2010) | ||
|
||
def test_hr_avg(self): | ||
self.assertEqual(int(self.tcx.hr_avg), 140) | ||
|
||
def test_hr_max(self): | ||
self.assertEqual(self.tcx.hr_max, None) | ||
|
||
def test_hr_min(self): | ||
self.assertEqual(self.tcx.hr_min, 94) | ||
|
||
def altitude_avg(self): | ||
self.assertEqual(self.tcx.altitude_avg, None) | ||
|
||
def test_altitude_min(self): | ||
self.assertAlmostEqual(self.tcx.altitude_min, -5.4, places=1) | ||
|
||
def test_ascent(self): | ||
self.assertAlmostEqual(self.tcx.ascent, 1404.4, places=1) | ||
|
||
def test_descent(self): | ||
self.assertAlmostEqual(self.tcx.descent, 1422.0, places=1) |