Skip to content

fix: attempt to fix issue with database initialization #155

fix: attempt to fix issue with database initialization

fix: attempt to fix issue with database initialization #155

GitHub Actions / Test Results (3.12) failed Aug 7, 2024 in 0s

11 passed, 1 failed and 0 skipped

Tests failed

❌ test-results.xml

12 tests were completed in 15s with 11 passed, 1 failed and 0 skipped.

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

❌ pytest

tests.test_main
  ✅ test_app_says_hello
  ✅ test_process_with_valid_config_does_not_error
  ✅ test_process_with_binary_hk_converts_to_csv
  ✅ test_fetch_binary_downloads_hk_from_webpoda
  ❌ test_fetch_science_downloads_cdf_from_sdc
	wiremock_manager = <tests.wiremockUtils.WireMockManager object at 0x7f636e8eb1d0>
  ✅ 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

Annotations

Check failure on line 0 in test-results.xml

See this annotation in the file changed.

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

pytest ► tests.test_main ► test_fetch_science_downloads_cdf_from_sdc

Failed test found in:
  test-results.xml
Error:
  wiremock_manager = <tests.wiremockUtils.WireMockManager object at 0x7f636e8eb1d0>
Raw output
wiremock_manager = <tests.wiremockUtils.WireMockManager object at 0x7f636e8eb1d0>

    def test_fetch_science_downloads_cdf_from_sdc(wiremock_manager):  # noqa: F811
        # Set up.
        query_response: list[dict[str, str]] = [
            {
                "file_path": "imap/mag/l1b/2025/05/imap_mag_l1b_norm-magi_20250502_v000.cdf",
                "instrument": "mag",
                "data_level": "l1b",
                "descriptor": "norm-magi",
                "start_date": "20250502",
                "repointing": None,
                "version": "v000",
                "extension": "cdf",
                "ingestion_date": "2024-07-16 10:29:02",
            }
        ]
        cdf_file = os.path.abspath(
            "tests/data/2025/imap_mag_l1b_norm-mago_20250502_v000.cdf"
        )
    
        wiremock_manager.add_string_mapping(
            "/query?instrument=mag&data_level=l1b&descriptor=norm-magi&start_date=20250502&end_date=20250502&extension=cdf",
            json.dumps(query_response),
            priority=1,
        )
        wiremock_manager.add_file_mapping(
            "/download/imap/mag/l1b/2025/05/imap_mag_l1b_norm-magi_20250502_v000.cdf",
            cdf_file,
        )
        wiremock_manager.add_string_mapping(
            re.escape("/query?instrument=mag&data_level=l1b&descriptor=")
            + ".*"
            + re.escape("&start_date=20250502&end_date=20250502&extension=cdf"),
            json.dumps({}),
            is_pattern=True,
            priority=2,
        )
    
        (_, config_file) = create_serialize_config(
            destination_file="result.cdf", sdc_url=wiremock_manager.get_url().rstrip("/")
        )
    
        # Exercise.
        result = runner.invoke(
            app,
            [
                "--verbose",
                "fetch-science",
                "--config",
                config_file,
                "--auth-code",
                "12345",
                "--level",
                "l1b",
                "--start-date",
                "2025-05-02",
                "--end-date",
                "2025-05-02",
            ],
        )
    
        print("\n" + str(result.stdout))
    
        # Verify.
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('max() iterable argument is empty')>.exit_code

tests/test_main.py:181: AssertionError