Skip to content

Commit

Permalink
use resources.as_file context
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Oct 1, 2022
1 parent 7589037 commit d56ae1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/models/openoil/test_openoil_custom_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def test_set_oil_type_json():
def test_set_oil_type_file():
o = OpenOil(loglevel=50)

f = resources.path('opendrift.models.openoil.adios.extra_oils', 'AD03128.json')
with resources.as_file(resources.files('opendrift.models.openoil.adios.extra_oils').joinpath('AD03128.json')) as f:
o.set_oiltype_from_file(f)

o.set_oiltype_from_file(f)
assert o.oiltype.name == 'VEGA CONDENSATE 2015'
print(o.oiltype)

0 comments on commit d56ae1f

Please sign in to comment.