Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Tests for utilFncs.py #697

Merged
merged 10 commits into from
Feb 3, 2025
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Unreleased]
### Changed
* Added unit tests for utilFncs.py
* [686](https://github.com/dbekaert/RAiDER/pull/686) - Linted the project with `ruff`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the changelog message to what you actually did. @royagrace
Also make sure the commit number is the correct number.

* [672](https://github.com/dbekaert/RAiDER/pull/672) - Linted the project with `ruff`.
* [683](https://github.com/dbekaert/RAiDER/pull/683) - Fixed a naive datetime and added default template to template generation argument

Expand Down
41 changes: 19 additions & 22 deletions test/test_gnss.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
from pathlib import Path
from RAiDER.models.customExceptions import NoStationDataFoundError
from RAiDER.gnss.downloadGNSSDelays import (
get_stats_by_llh, get_station_list, download_tropo_delays,
filterToBBox
)
from RAiDER.gnss.processDelayFiles import (
addDateTimeToFiles,
getDateTime,
concatDelayFiles
)
import datetime
import os
import pytest
from pathlib import Path

import pandas as pd
import pytest

from RAiDER.gnss.downloadGNSSDelays import download_tropo_delays, filterToBBox, get_station_list, get_stats_by_llh
from RAiDER.gnss.processDelayFiles import addDateTimeToFiles, concatDelayFiles, getDateTime
from RAiDER.models.customExceptions import NoStationDataFoundError
from test import TEST_DIR, pushd


from test import pushd, TEST_DIR
SCENARIO2_DIR = os.path.join(TEST_DIR, "scenario_2")


Expand Down Expand Up @@ -125,17 +120,19 @@ def test_download_tropo_delays2():


def test_download_tropo_delays2(tmp_path):
stations, output_file = get_station_list(
stationFile=os.path.join(SCENARIO2_DIR, 'stations.csv'))
with pushd(tmp_path):
stations, output_file = get_station_list(
stationFile=os.path.join(SCENARIO2_DIR, 'stations.csv')
)

# spot check a couple of stations
assert 'CAPE' in stations
assert 'FGNW' in stations
assert isinstance(output_file, str)
# spot check a couple of stations
assert 'CAPE' in stations
assert 'FGNW' in stations
assert isinstance(output_file, str)

# try downloading the delays
download_tropo_delays(stats=stations, years=[2022], writeDir=tmp_path)
assert True
# try downloading the delays
download_tropo_delays(stats=stations, years=[2022], writeDir=tmp_path)
assert True


def test_filterByBBox1():
Expand Down
Loading
Loading