|
4 | 4 | get_path_to_invalid_load, |
5 | 5 | get_path_to_invalid_schema, |
6 | 6 | get_path_to_sample_load_parquet_as_pandas, |
| 7 | + get_path_to_sample_load_parquet_as_pandas_with_sample_frac, |
| 8 | + get_path_to_sample_load_parquet_as_pandas_with_sample_n, |
7 | 9 | get_path_to_sample_parquet, |
8 | 10 | get_path_to_sample_schema, |
9 | 11 | get_path_to_schema_incompatible_with_sample_df, |
@@ -75,6 +77,29 @@ def test_if_load_does_not_contain_expected_function_then_raise_exception(pyproje |
75 | 77 | ) |
76 | 78 |
|
77 | 79 |
|
| 80 | +def test_if_load_contain_optional_arguments_then_do_not_raise_exception(pyproject: PyProjectConfig): |
| 81 | + with TemporaryDirectory() as tmp_dir: |
| 82 | + PackConfig( |
| 83 | + data_path=get_path_to_sample_parquet(), |
| 84 | + load_path=get_path_to_sample_load_parquet_as_pandas_with_sample_frac(), |
| 85 | + schema_path=get_path_to_sample_schema(), |
| 86 | + wheel_dir=Path(tmp_dir), |
| 87 | + pyproject=pyproject, |
| 88 | + ) |
| 89 | + |
| 90 | + |
| 91 | +def test_if_load_contain_non_optional_arguments_then_raise_exception(pyproject: PyProjectConfig): |
| 92 | + with TemporaryDirectory() as tmp_dir: |
| 93 | + with pytest.raises(ValueError): |
| 94 | + PackConfig( |
| 95 | + data_path=get_path_to_sample_parquet(), |
| 96 | + load_path=get_path_to_sample_load_parquet_as_pandas_with_sample_n(), |
| 97 | + schema_path=get_path_to_sample_schema(), |
| 98 | + wheel_dir=Path(tmp_dir), |
| 99 | + pyproject=pyproject, |
| 100 | + ) |
| 101 | + |
| 102 | + |
78 | 103 | def test_if_invalid_schema_path_then_raise_exception(pyproject: PyProjectConfig): |
79 | 104 | with TemporaryDirectory() as tmp_dir: |
80 | 105 | with pytest.raises(ValueError): |
|
0 commit comments