Skip to content

Commit

Permalink
Addressed the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nargis Sultani committed Sep 28, 2023
1 parent 44e9fd4 commit 05e55e4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ failed validation.
# Test validating the "good" file
# If passing lei value, pass lei as first arg and csv_path as second arg
# else just pass the csv_path as arg
python src/validator/main.py src/tests/data/SBL_Validations_SampleData_GoodFile_03312023.csv
python src/validator/main.py src/tests/data/sbl-validations-pass.csv

# Test validating the "bad" file
python src/validator/main.py src/tests/data/SBL_Validations_SampleData_BadFile_03312023.csv
python src/validator/main.py src/tests/data/sbl-validations-fail.csv
```

## Development
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 4 additions & 10 deletions src/tests/test_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # noqa: E402
sys.path.append(ROOT_DIR) # noqa: E402

GOOD_FILE_PATH = "./src/tests/data/SBL_Validations_SampleData_GoodFile_03312023.csv"
BAD_FILE_PATH = "./src/tests/data/SBL_Validations_SampleData_BadFile_03312023.csv"
GOOD_FILE_PATH = "./src/tests/data/sbl-validations-pass.csv"
BAD_FILE_PATH = "./src/tests/data/sbl-validations-fail.csv"


class TestValidatingSampleData:
Expand All @@ -19,14 +19,8 @@ class TestValidatingSampleData:
good_file_df = pd.read_csv(GOOD_FILE_PATH, dtype=str, na_filter=False)
bad_file_df = pd.read_csv(BAD_FILE_PATH, dtype=str, na_filter=False)

def test_invalid_good_data_file(self):
failed_fpath = "./SBL_Validations_SampleData_GoodFile_03312023_1.csv"
with pytest.raises(Exception) as exc:
pd.read_csv(failed_fpath, dtype=str, na_filter=False)
assert exc.type == FileNotFoundError

def test_invalid_bad_data_file(self):
failed_fpath = "./SBL_Validations_SampleData_BadFile_03312023_1.csv"
def test_invalid_data_file(self):
failed_fpath = "./file-does-not-exist.csv"
with pytest.raises(Exception) as exc:
pd.read_csv(failed_fpath, dtype=str, na_filter=False)
assert exc.type == FileNotFoundError
Expand Down
1 change: 1 addition & 0 deletions src/validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def run_validation_on_df(df: pd.DataFrame, lei: str) -> None:
print("")
print(df)
print("")

print(validate_phases(df, lei))


Expand Down

0 comments on commit 05e55e4

Please sign in to comment.