import os
from unittest import TestCase

from tcxparser import TCXParser


class TestParseCyclingTCX(TestCase):
    def setUp(self):
        tcx_file = "test2.tcx"
        path = os.path.join(os.path.dirname(__file__), "files", tcx_file)
        self.tcx = TCXParser(path)

    def test_cadence_max_is_correct(self):
        self.assertEqual(self.tcx.cadence_max, 115)

    def test_cadence_avg_is_correct(self):
        self.assertEqual(self.tcx.cadence_avg, 82)

import os
from unittest import TestCase

from tcxparser import TCXParser


class TestParseCyclingTCX(TestCase):
    def setUp(self):
        """
        TCX file test2.tcx was taken from the following dataset:
        S. Rauter, I. Jr. Fister, I. Fister. A collection of sport activity files
        for data analysis and data mining.
        Technical report 0201, University of Ljubljana and University of Maribor, 2015.
        """
        tcx_file = "test2.tcx"
        path = os.path.join(os.path.dirname(__file__), "files", tcx_file)
        self.tcx = TCXParser(path)

    def test_cadence_max_is_correct(self):
        self.assertEqual(self.tcx.cadence_max, 115)

    def test_cadence_avg_is_correct(self):
        self.assertEqual(self.tcx.cadence_avg, 82)

Add a source of test file
Add a source of test file

  import os
  from unittest import TestCase
  
  from tcxparser import TCXParser
  
  
  class TestParseCyclingTCX(TestCase):
      def setUp(self):
+         """
+         TCX file test2.tcx was taken from the following dataset:
+         S. Rauter, I. Jr. Fister, I. Fister. A collection of sport activity files
+         for data analysis and data mining.
+         Technical report 0201, University of Ljubljana and University of Maribor, 2015.
+         """
          tcx_file = "test2.tcx"
          path = os.path.join(os.path.dirname(__file__), "files", tcx_file)
          self.tcx = TCXParser(path)
  
      def test_cadence_max_is_correct(self):
          self.assertEqual(self.tcx.cadence_max, 115)
  
      def test_cadence_avg_is_correct(self):
          self.assertEqual(self.tcx.cadence_avg, 82)
  
Add a source of test file
## Code Before:
import os
from unittest import TestCase

from tcxparser import TCXParser


class TestParseCyclingTCX(TestCase):
    def setUp(self):
        tcx_file = "test2.tcx"
        path = os.path.join(os.path.dirname(__file__), "files", tcx_file)
        self.tcx = TCXParser(path)

    def test_cadence_max_is_correct(self):
        self.assertEqual(self.tcx.cadence_max, 115)

    def test_cadence_avg_is_correct(self):
        self.assertEqual(self.tcx.cadence_avg, 82)

## Instruction:
Add a source of test file
## Code After:
import os
from unittest import TestCase

from tcxparser import TCXParser


class TestParseCyclingTCX(TestCase):
    def setUp(self):
        """
        TCX file test2.tcx was taken from the following dataset:
        S. Rauter, I. Jr. Fister, I. Fister. A collection of sport activity files
        for data analysis and data mining.
        Technical report 0201, University of Ljubljana and University of Maribor, 2015.
        """
        tcx_file = "test2.tcx"
        path = os.path.join(os.path.dirname(__file__), "files", tcx_file)
        self.tcx = TCXParser(path)

    def test_cadence_max_is_correct(self):
        self.assertEqual(self.tcx.cadence_max, 115)

    def test_cadence_avg_is_correct(self):
        self.assertEqual(self.tcx.cadence_avg, 82)
