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

feat: File management for fetch-binary and fetch-science functions #17

Open
wants to merge 105 commits into
base: main
Choose a base branch
from

task: multiple changes

df8f4ab
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

feat: File management for fetch-binary and fetch-science functions #17

task: multiple changes
df8f4ab
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Results (3.11) failed Oct 24, 2024 in 2s

23 passed, 1 failed and 0 skipped

Tests failed

❌ test-results.xml

24 tests were completed in 15s with 23 passed, 1 failed and 0 skipped.

Test suite Passed Failed Skipped Time
pytest 23✅ 1❌ 15s

❌ pytest

tests.test_appUtils
  ✅ test_get_packet_from_apid_errors_on_invalid_apid
  ✅ test_convert_to_datetime_on_invalid_datetime
tests.test_database
  ✅ test_database_output_manager_writes_to_database
  ✅ test_database_output_manager_errors_when_destination_file_is_not_found
  ✅ test_database_output_manager_errors_destination_file_different_hash
  ✅ test_database_output_manager_errors_database_error
tests.test_fetchBinary
  ✅ test_fetch_binary_empty_download_not_added_to_output
  ✅ test_fetch_binary_with_same_start_end_date
tests.test_fetchScience
  ✅ test_fetch_science_no_matching_files
  ✅ test_fetch_science_with_same_start_end_date
tests.test_main
  ✅ test_app_says_hello
  ✅ test_process_with_valid_config_does_not_error
  ❌ test_process_with_binary_hk_converts_to_csv
	def test_process_with_binary_hk_converts_to_csv():
  ✅ test_fetch_binary_downloads_hk_from_webpoda
  ✅ test_fetch_science_downloads_cdf_from_sdc
  ✅ test_calibration_creates_calibration_file
  ✅ test_application_creates_L2_file
tests.test_outputManager
  ✅ test_copy_new_file
  ✅ test_copy_file_same_content
  ✅ test_copy_file_existing_versions
  ✅ test_copy_file_forced_version
  ✅ test_copy_file_custom_providers
tests.test_sdcDataAccess
  ✅ test_sdc_data_access_constructor_sets_config
  ✅ test_get_file_path_builds_file_path

Annotations

Check failure on line 0 in test-results.xml

See this annotation in the file changed.

@github-actions github-actions / Test Results (3.11)

pytest ► tests.test_main ► test_process_with_binary_hk_converts_to_csv

Failed test found in:
  test-results.xml
Error:
  def test_process_with_binary_hk_converts_to_csv():
Raw output
def test_process_with_binary_hk_converts_to_csv():
        # Set up.
        expectedHeader = "epoch,shcoarse,pus_spare1,pus_version,pus_spare2,pus_stype,pus_ssubtype,hk_strucid,p1v5v,p1v8v,p3v3v,p2v5v,p8v,n8v,icu_temp,p2v4v,p1v5i,p1v8i,p3v3i,p2v5i,p8vi,n8vi,fob_temp,fib_temp,magosatflagx,magosatflagy,magosatflagz,magisatflagx,magisatflagy,magisatflagz,spare1,magorange,magirange,spare2,magitfmisscnt,version,type,sec_hdr_flg,pkt_apid,seq_flgs,src_seq_ctr,pkt_len\n"
        expectedFirstLine = "799424368184000000,483848304,0,1,0,3,25,3,1.52370834,1.82973516,3.3652049479999997,2.54942028,9.735992639,-9.7267671632,19.470153600000003,2.36297684,423.7578925213,18.436028516,116.40531765999998,87.2015252,119.75070000000001,90.32580000000002,19.640128302955475,19.482131117873905,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1063,3,0,43\n"
        expectedLastLine = "799437851184000000,483861787,0,1,0,3,25,3,1.52370834,1.82973516,3.3652049479999997,2.54942028,9.555648769,-9.5531674296,26.019506700000022,2.3559926719999997,419.9364473837,31.800489164000002,131.13964636,92.94935734500001,193.83599999999998,154.8802,25.938177593750083,25.628958683022688,0,0,0,0,0,0,0,3,3,0,0,0,0,1,1063,3,495,43\n"
        expectedNumRows = 1335
    
        # Exercise.
        result = runner.invoke(
            app,
            [
                "process",
                "--config",
                "tests/config/hk_process.yaml",
                "MAG_HSK_PW.pkts",
            ],
        )
    
        print("\n" + str(result.stdout))
    
        # Verify.
        assert result.exit_code == 0
        assert Path("output/result.csv").exists()
    
        with open("output/result.csv") as f:
            lines = f.readlines()
>           assert expectedHeader == lines[0]
E           AssertionError: assert 'epoch,shcoar...ctr,pkt_len\n' == 'epoch,mag_hs...ctr,pkt_len\n'
E             
E             - epoch,mag_hsk_pw_shcoarse,mag_hsk_pw_pus_spare1,mag_hsk_pw_pus_version,mag_hsk_pw_pus_spare2,mag_hsk_pw_pus_stype,mag_hsk_pw_pus_ssubtype,mag_hsk_pw_hk_strucid,mag_hsk_pw_p1v5v,mag_hsk_pw_p1v8v,mag_hsk_pw_p3v3v,mag_hsk_pw_p2v5v,mag_hsk_pw_p8v,mag_hsk_pw_n8v,mag_hsk_pw_icu_temp,mag_hsk_pw_p2v4v,mag_hsk_pw_p1v5i,mag_hsk_pw_p1v8i,mag_hsk_pw_p3v3i,mag_hsk_pw_p2v5i,mag_hsk_pw_p8vi,mag_hsk_pw_n8vi,mag_hsk_pw_fob_temp,mag_hsk_pw_fib_temp,mag_hsk_pw_magosatflagx,mag_hsk_pw_magosatflagy,mag_hsk_pw_magosatflagz,mag_hsk_pw_magisatflagx,mag_hsk_pw_magisatflagy,mag_hsk_pw_magisatflagz,mag_hsk_pw_spare1,mag_hsk_pw_magorange,mag_hsk_pw_magirange,mag_hsk_pw_spare2,mag_hsk_pw_magitfmisscnt,version,type,sec_hdr_flg,pkt_apid,seq_flgs,src_seq_ctr,pkt_len
E             + epoch,shcoarse,pus_spare1,pus_version,pus_spare2,pus_stype,pus_ssubtype,hk_strucid,p1v5v,p1v8v,p3v3v,p2v5v,p8v,n8v,icu_temp,p2v4v,p1v5i,p1v8i,p3v3i,p2v5i,p8vi,n8vi,fob_temp,fib_temp,magosatflagx,magosatflagy,magosatflagz,magisatflagx,magisatflagy,magisatflagz,spare1,magorange,magirange,spare2,magitfmisscnt,version,type,sec_hdr_flg,pkt_apid,seq_flgs,src_seq_ctr,pkt_len

tests/test_main.py:70: AssertionError