-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
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,25 @@ | ||
name: ci | ||
on: [push] | ||
|
||
jobs: | ||
activate: | ||
runs-on: self-ubuntu-22.04 | ||
if: | | ||
github.repository == 'FABallemand/ezGPX' && | ||
!startsWith(github.event.head_commit.message, 'Release ') && | ||
!contains(github.event.head_commit.message, 'ci skip') | ||
steps: | ||
- run: echo ready | ||
|
||
tests: | ||
needs: activate | ||
runs-on: self-ubuntu-22.04 | ||
steps: | ||
- name: install and upgrade necessary packages | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install pytest pandas | ||
- name: tests | ||
run: | | ||
python3 -c"import sys; print(sys.path)" | ||
python3 -m pytest -s |
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,4 +1,4 @@ | ||
from track_extensions import * | ||
from .track_extensions import * | ||
from .track_segment import * | ||
|
||
class Track(): | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,42 @@ | ||
import sys | ||
import os | ||
import pytest | ||
from shutil import rmtree | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
file_folder = os.path.dirname(__file__) | ||
parent_folder = os.path.realpath(os.path.dirname(file_folder)) # ie: ezGPX | ||
|
||
os.chdir(file_folder) | ||
sys.path.append(parent_folder + "/ezgpx") | ||
|
||
from ezgpx import GPX | ||
|
||
class TestGPX(): | ||
|
||
def test_plot(self, remove_tmp: bool = True): | ||
# Create temporary folder | ||
rmtree("tmp", True) | ||
os.makedirs(os.path.dirname(__file__) + "/tmp") | ||
|
||
# Plot | ||
test_gpx = GPX("../test_files/files/strava_running_1.gpx") | ||
test_gpx.plot(start_stop=True, elevation_color=True, file_path="tmp/strava_running_1_start_stop_elevation.png") | ||
|
||
# Load images | ||
test_img = plt.imread("tmp/strava_running_1_start_stop_elevation.png") | ||
ref_img = plt.imread("../test_files/reference_files/strava_running_1_start_stop_elevation.png") | ||
|
||
res = np.array_equal(test_img, ref_img) | ||
|
||
# Create temporary folder | ||
if remove_tmp: | ||
rmtree("tmp") | ||
|
||
assert(res) | ||
|
||
@pytest.mark.skip(reason="test") # https://docs.pytest.org/en/7.3.x/how-to/skipping.html | ||
def test_test(self): | ||
print("Testing...") |