test_ephemeris_downloader module

Tests for the ephemeris class that returns satellite ephemerides.

test_ephemeris_downloader.download_igs(requests_url)[source]

Helper function to capture ConnectionError.

Parameters:

requests_url (string) – URL for requests input.

test_ephemeris_downloader.fixture_all_ephem_paths(ephem_path)[source]

Location of ephemeris files for unit test

Parameters:

ephem_path (string) – Location where ephemeris files are stored/to be downloaded.

Returns:

all_ephem_paths – Location of all unit test ephemeris files.

Return type:

string

test_ephemeris_downloader.fixture_ephem_download_path()[source]

Location of ephemeris files for unit test

Returns:

ephem_download_path – Location where ephemeris files are stored/to be downloaded.

Return type:

string

test_ephemeris_downloader.fixture_ephem_path()[source]

Location of ephemeris files for unit test

Returns:

ephem_path – Location where ephemeris files are stored/to be downloaded.

Return type:

string

test_ephemeris_downloader.remove_download_eph(ephem_download_path)[source]

Remove previous directory

Parameters:

ephem_download_path (string) – Location where ephemeris files are stored/to be downloaded.

test_ephemeris_downloader.test_clk_different_source(ephem_datetime, possible_types, paths)[source]

Test using a different source for clk.

Parameters:
  • ephem_datetime (datetime.datetime) – Ephemeris clock time

  • possible_types (list) – What file types would fulfill the requirement in preference order.

  • paths (string or path-like) – Paths to existing ephemeris files if they exist.

test_ephemeris_downloader.test_ephemeris_fails()[source]

Test ways the ephemeris downloader should fail.

test_ephemeris_downloader.test_extract_ephemeris_dates()[source]

Test extracting the correct days from timestamps.

Datetime format is: (Year, Month, Day, Hr, Min, Sec, Microsecond)

test_ephemeris_downloader.test_ftp_download(ephem_download_path)[source]

Test FTP download for ephemeris files.

Parameters:

ephem_download_path (string) – Location where ephemeris files are stored/to be downloaded to.

test_ephemeris_downloader.test_ftp_errors(ephem_download_path)[source]

Test FTP download errors.

Parameters:

ephem_download_path (string) – Location where ephemeris files are stored/to be downloaded.

test_ephemeris_downloader.test_load_ephemeris_rinex_nav(ephem_params, ephem_path, paths)[source]

Test verifying ephemeris.

Parameters:
  • ephem_params (tuple) – Tuple of datetime.datetime for ephemeris clock time and constellation list for which to download ephemeris.

  • ephem_path (string or path-like) – Directory where ephemeris files are downloaded if necessary.

  • paths (string or path-like) – Paths to existing ephemeris files if they exist.

test_ephemeris_downloader.test_load_sp3_clk(ephem_datetime, file_type, ephem_path, paths)[source]

Test verifying ephemeris.

Parameters:
  • ephem_datetime (datetime.datetime) – Days in UTC for which ephemeris needs to be retrieved.

  • file_type (string) – File type to download either “rinex_nav”, “sp3”, or “clk”.

  • ephem_path (string or path-like) – Directory where ephemeris files are downloaded if necessary.

  • paths (string or path-like) – Paths to existing ephemeris files if they exist.

test_ephemeris_downloader.test_request_igs(capsys, ephem_download_path)[source]

Test requests download for igs files.

The reason for this test is that Github workflow actions seem to block international IPs and so won’t properly bind to the igs IP.

Parameters:

ephem_download_path (string) – Location where ephemeris files are stored/downloaded.

test_ephemeris_downloader.test_rinex_different_monument(ephem_params, ephem_path, paths)[source]

Test using a different monument.

Parameters:
  • ephem_params (tuple) – Tuple of datetime.datetime for ephemeris clock time and constellation list for which to download ephemeris.

  • ephem_path (string or path-like) – Directory where ephemeris files are downloaded if necessary.

  • paths (string or path-like) – Paths to existing ephemeris files if they exist.

test_ephemeris_downloader.test_sp3_different_source(ephem_datetime, possible_types, paths)[source]

Test using a different source for sp3.

Parameters:
  • ephem_datetime (datetime.datetime) – Ephemeris clock time

  • possible_types (list) – What file types would fulfill the requirement in preference order.

  • paths (string or path-like) – Paths to existing ephemeris files if they exist.

test_ephemeris_downloader.test_valid_ephemeris(all_ephem_paths, sp3_path, clk_path)[source]

Extra tests for full valid coverage.

Parameters:
  • all_ephem_paths (string) – Location of all unit test ephemeris files.

  • sp3_path (string) – String with location for the unit_test sp3 measurements

  • clk_path (string) – String with location for the unit_test clk measurements

test_ephemeris_downloader.test_verify_ephemeris()[source]

Test verify ephemeris for today’s.