Skip to content

Commit 06d8d9b

Browse files
committed
use pathlib for test data
1 parent 24ea737 commit 06d8d9b

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ global-exclude \#*
2626
global-exclude .ipynb_checkpoints
2727

2828
include versioneer.py
29-
include solarforecastarbiter/_version.py
29+
include solarforecastarbiter/_version.py

solarforecastarbiter/io/reference_observations/tests/conftest.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import copy
22
import json
3-
from pkg_resources import resource_filename, Requirement
3+
from pathlib import Path
44

55

66
import numpy as np
@@ -157,7 +157,4 @@ def mock_fetch(mocker, fake_ghi_data):
157157

158158
@pytest.fixture
159159
def test_json_site_file():
160-
return resource_filename(
161-
Requirement.parse('solarforecastarbiter'),
162-
'solarforecastarbiter/io/reference_observations/'
163-
'tests/data/test_site.json')
160+
return Path(__file__).resolve().parents[0] / 'data/test_site.json'

solarforecastarbiter/io/reference_observations/tests/test_common.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,3 +788,14 @@ def test_apply_json_site_parameters_plant(test_json_site_file, params):
788788
{'extra_parameters': params},
789789
)
790790
assert 'modeling_parameters' in new_site
791+
792+
793+
@pytest.mark.parametrize('params', [
794+
{'network_api_id': 'not_plant'},
795+
])
796+
def test_apply_json_site_parameters_no_modeling(test_json_site_file, params):
797+
new_site = common.apply_json_site_parameters(
798+
test_json_site_file,
799+
{'extra_parameters': params},
800+
)
801+
assert 'modeling_parameters' not in new_site

0 commit comments

Comments
 (0)