Spaces:
Sleeping
Sleeping
Download tests/test_utils.py from faseehsandhu/Digitalytics: direct link, hf CLI and curl.
- Browser
- Download file 732 Bytes
-
https://huggingface.co/spaces/faseehsandhu/Digitalytics/resolve/main/tests/test_utils.py
- Command line
-
hf download hf://spaces/faseehsandhu/Digitalytics/tests/test_utils.py
-
curl -L -o test_utils.py https://huggingface.co/spaces/faseehsandhu/Digitalytics/resolve/main/tests/test_utils.py
732 Bytes
| import pytest | |
| from src.utils.validators import validate_file_format, validate_data_dictionary | |
| def test_validate_file_format(): | |
| assert validate_file_format("data.xlsx") == True | |
| assert validate_file_format("data.pdf") == True | |
| assert validate_file_format("data.txt") == False | |
| assert validate_file_format("data.csv") == True | |
| def test_validate_data_dictionary(): | |
| valid_dict = { | |
| "columns": ["age", "gender", "income"], | |
| "data": [[25, "M", 50000], [30, "F", 60000]] | |
| } | |
| invalid_dict = { | |
| "columns": ["age", "gender"], | |
| "data": [[25, "M"], [30, "F", 60000]] | |
| } | |
| assert validate_data_dictionary(valid_dict) == True | |
| assert validate_data_dictionary(invalid_dict) == False |