Skip to content

Commit

Permalink
test oed_v4
Browse files Browse the repository at this point in the history
  • Loading branch information
sstruzik committed Jan 23, 2025
1 parent 5acc3cf commit a815874
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions ods_tools/oed/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ def load_dataframe(self, version_name=None):
read_params = {'keep_default_na': False,
'na_values': PANDAS_DEFAULT_NULL_VALUES.difference({'NA'})}
read_params.update(source.get('read_param', {}))
print(filepath)
oed_df = self.read_csv(filepath, self.exposure.get_input_fields(self.oed_type), filter=self.filters, **read_params)
else:
raise Exception(f"Source type {source['source_type']} is not supported")
Expand Down
14 changes: 7 additions & 7 deletions tests/test_ods_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,35 @@ def test_oed_V3(self):
assert OedExposure(**config).class_of_business == ClassOfBusiness.prop

def test_oed_cyber_example(self):
oed_example_url = "https://raw.githubusercontent.com/OasisLMF/ODS_OpenExposureData/refs/heads/release/4.0.0/Examples"
oed_example_url = "https://raw.githubusercontent.com/OasisLMF/ODS_OpenExposureData/refs/heads/main/Examples"
config = {
'account': oed_example_url + '/cyber_account.csv',
'oed_schema_info': "/home/sstruzik/test/cyber_model/V2/OpenExposureData_Spec.json",
'oed_schema_info': '/home/sstruzik/tests/OED_V4/OpenExposureData_Spec.json',
'check_oed': True,
'use_field': True,
}
assert OedExposure(**config).class_of_business == ClassOfBusiness.cyb

def test_oed_marinecargo_example(self):
oed_example_url = "https://raw.githubusercontent.com/OasisLMF/ODS_OpenExposureData/refs/heads/release/4.0.0/Examples"
oed_example_url = "https://raw.githubusercontent.com/OasisLMF/ODS_OpenExposureData/refs/heads/main/Examples"
config = {
'location': oed_example_url + '/marinecargo_location.csv',
'account': oed_example_url + '/marinecargo_account.csv',
'oed_schema_info': "/home/sstruzik/test/cyber_model/V2/OpenExposureData_Spec.json",
'oed_schema_info': '/home/sstruzik/tests/OED_V4/OpenExposureData_Spec.json',
'check_oed': True,
'use_field': True,
}
assert OedExposure(**config).class_of_business in [ClassOfBusiness.prop, ClassOfBusiness.mar]

def test_oed_liability_example(self):
oed_example_url = "https://raw.githubusercontent.com/OasisLMF/ODS_OpenExposureData/refs/heads/release/4.0.0/Examples"
oed_example_url = "https://raw.githubusercontent.com/OasisLMF/ODS_OpenExposureData/refs/heads/main/Examples"
config = {
'account': oed_example_url + '/liability_account.csv',
'oed_schema_info': "/home/sstruzik/test/cyber_model/V2/OpenExposureData_Spec.json",
'oed_schema_info': '/home/sstruzik/tests/OED_V4/OpenExposureData_Spec.json',
'check_oed': True,
'use_field': True,
}
assert OedExposure(**config).class_of_business == ClassOfBusiness.cyb
assert OedExposure(**config).class_of_business == ClassOfBusiness.liabs



Expand Down

0 comments on commit a815874

Please sign in to comment.