Skip to content

Commit 3218ab5

Browse files
authored
Add test_bsrn file
File is not complete, as I'm awaiting permission from BSRN to upload test file
1 parent 2eb3d44 commit 3218ab5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

pvlib/tests/iotools/test_bsrn.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
tests for :mod:`pvlib.iotools.bsrn`
3+
"""
4+
5+
6+
import pandas as pd
7+
import pytest
8+
9+
from pvlib.iotools import bsrn
10+
from conftest import DATA_DIR
11+
12+
13+
# Awaiting permission from BSRN to upload test file
14+
testfile = DATA_DIR / 'bsrn_xxxxx.dat'
15+
16+
17+
def test_read_bsrn_columns():
18+
data = bsrn.read_bsrn(testfile)
19+
assert 'ghi' in data.columns
20+
assert 'dni_std' in data.columns
21+
assert 'dhi_min' in data.columns
22+
assert 'lwd_max' in data.columns
23+
assert 'relative_humidity' in data.columns
24+
25+
26+
@pytest.fixture
27+
def expected_index():
28+
start = pd.Timestamp(2020,1,1,0,0)
29+
return pd.date_range(start=start, periods=1440, freq='1min', tz='UTC')
30+
31+
32+
def test_format_index():
33+
actual = bsrn.read_bsrn(testfile)
34+
assert actual.index.equals(expected_index)

0 commit comments

Comments
 (0)