Пример #1
0
    def test_running_smoketest(self):
        # Setup
        workout_data = self.loadTestData("peloton_workout_running.json")
        workout_summary = self.loadTestData("peloton_workoutsummary_running.json")
        workout_samples = self.loadTestData("peloton_workoutsamples_running.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(workout_data, workout_summary, workout_samples, output_directory)
        
        # Assert
        assert title == "20 min Pop Fun Run with Olivia Amato"
        assert filename == "1565299850-20 min Pop Fun Run with Olivia Amato-63eef26a23744af295f14006811b159b.tcx"
        assert garmin_activity_type == "treadmill_running"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Running", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)
        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)
        TCX.assertTcxAvgHeartRateMatches(workout_summary,tcx)
        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)
Пример #2
0
    def test_running_outdoor_smoketest(self):
        # Setup
        workout_data = self.loadTestData("peloton_workout_running_outdoor.json")
        workout_summary = self.loadTestData("peloton_workoutsummary_running_outdoor.json")
        workout_samples = self.loadTestData("peloton_workoutsamples_running_outdoor.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(workout_data, workout_summary, workout_samples, output_directory)
        
        # Assert
        assert title == "20 min Walk + Run with Olivia Amato"
        assert filename == "1574980432-20 min Walk + Run with Olivia Amato-af25d72ea4c0400daeac2707fc30994f.tcx"
        assert garmin_activity_type == "walking"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Running", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)
        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)
        TCX.assertTcxAvgHeartRateMatches(workout_summary,tcx)
        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)
Пример #3
0
    def test_strength_smoketest(self):
        # Setup
        workout_data = self.loadTestData("peloton_workout_strength.json")
        workout_summary = self.loadTestData("peloton_workoutsummary_strength.json")
        workout_samples = self.loadTestData("peloton_workoutsamples_strength.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(workout_data, workout_summary, workout_samples, output_directory)
        
        # Assert
        assert title == "10 min Bodyweight Strength with Becs Gentry"
        assert filename == "1589907174-10 min Bodyweight Strength with Becs Gentry-38583cbc0e434e54a2eb91be1a770e01.tcx"
        assert garmin_activity_type == "strength_training"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Other", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)
        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)
        TCX.assertTcxAvgHeartRateMatches(workout_summary,tcx)
        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)
Пример #4
0
    def test_cycling_freestyle_smoketest(self):
        # Setup
        workout_data = self.loadTestData(
            "peloton_workout_cycling_freestyle.json")
        workout_summary = self.loadTestData(
            "peloton_workoutsummary_cycling_freestyle.json")
        workout_samples = self.loadTestData(
            "peloton_workoutsamples_cycling_freestyle.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(
            workout_data, workout_summary, workout_samples, output_directory)

        # Assert
        assert title == "27 sec Just Ride"
        assert filename == "1595374979-27 sec Just Ride-88963f6daf89445387da4ee2e26015f9.tcx"
        assert garmin_activity_type == "indoor_cycling"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Biking", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)
        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)
        TCX.assertTcxAvgHeartRateMatches(workout_summary, tcx)
        TCX.assertTcxAvgSpeedMatches(workout_samples, tcx)
        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)
Пример #5
0
    def test_cycling_km_smoketest(self):
        # Setup
        workout_data = self.loadTestData("peloton_workout_cycling_km.json")
        workout_summary = self.loadTestData(
            "peloton_workoutsummary_cycling_km.json")
        workout_samples = self.loadTestData(
            "peloton_workoutsamples_cycling_km.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(
            workout_data, workout_summary, workout_samples, output_directory)

        # Assert
        assert title == "20 min 2010s Pop Ride with Tunde Oyeneyin"
        assert filename == "1598294050-20 min 2010s Pop Ride with Tunde Oyeneyin-6a8b9725f87346b9a84c917c32a02df6.tcx"
        assert garmin_activity_type == "indoor_cycling"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Biking", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)
        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)
        TCX.assertTcxAvgHeartRateMatches(workout_summary, tcx)
        TCX.assertTcxAvgSpeedMatches(workout_samples, tcx)
        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)
Пример #6
0
    def test_cycling_smoketest(self):
        # Setup
        workout_data = self.loadTestData("peloton_workout_cycling.json")
        workout_summary = self.loadTestData(
            "peloton_workoutsummary_cycling.json")
        workout_samples = self.loadTestData(
            "peloton_workoutsamples_cycling.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(
            workout_data, workout_summary, workout_samples, output_directory)

        # Assert
        assert title == "20 min HIIT Ride with Denis Morton"
        assert filename == "1586208689-20 min HIIT Ride with Denis Morton-6c4d525d20134c74b7395991ed6912ce.tcx"
        assert garmin_activity_type == "indoor_cycling"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Biking", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)
        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)
        TCX.assertTcxAvgHeartRateMatches(workout_summary, tcx)
        TCX.assertTcxAvgSpeedMatches(workout_samples, tcx)
        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)
Пример #7
0
    def test_cycling_smoketest(self):
        # Setup
        workout_data = self.loadTestData("peloton_workout_cycling.json")
        workout_summary = self.loadTestData(
            "peloton_workoutsummary_cycling.json")
        workout_samples = self.loadTestData(
            "peloton_workoutsamples_cycling.json")
        output_directory = self.getOutputDir()

        # Act
        title, filename, garmin_activity_type = tcx_builder.workoutSamplesToTCX(
            workout_data, workout_summary, workout_samples, output_directory)

        # Assert
        assert title == "30 min Holiday Ride with Denis Morton"
        assert filename == "1607634579-30 min Holiday Ride with Denis Morton-d49cc8314b4e4f7ca1726394a90f6757.tcx"
        assert garmin_activity_type == "indoor_cycling"
        assert os.path.exists(os.path.join(output_directory, filename))

        tcx = self.loadOutputTCX(os.path.join(output_directory, filename))
        TCX.assertTcxSportMatches("Biking", tcx)
        TCX.assertTcxIdMatches(workout_data, tcx)

        TCX.assertTcxLapStartTimeMatches(workout_data, tcx)
        TCX.assertTcxTotalTimeSecondsMatches(workout_data, tcx)
        TCX.assertTcxTriggerMethodMatches(workout_summary, tcx)
        TCX.assertTcxIntensityMatches(workout_summary, tcx)

        TCX.assertTcxTotalPowerMatches(workout_summary, tcx)
        TCX.assertTcxMaximumSpeedMatches(workout_samples, tcx)
        TCX.assertTcxCaloriesMatches(workout_summary, tcx)

        TCX.assertTcxAvgHeartRateMatches(workout_summary, tcx)
        TCX.assertTcxMaxHeartRateMatches(workout_summary, tcx)

        TCX.assertTcxMaxBikeCadenceMatches(workout_summary, tcx)
        TCX.assertTcxAvgBikeCadenceMatches(workout_summary, tcx)

        TCX.assertTcxAvgWattsMatches(workout_summary, tcx)
        TCX.assertTcxMaxWattsMatches(workout_summary, tcx)

        TCX.assertTcxAvgResistanceMatches(workout_summary, tcx)
        TCX.assertTcxMaxResistanceMatches(workout_summary, tcx)