Skip to content

Commit

Permalink
Merge pull request #8 from ckrening/panond_2
Browse files Browse the repository at this point in the history
improved testing panond reader
  • Loading branch information
ckrening committed Jun 29, 2023
2 parents 519d4a7 + eb7f3ee commit da5e7b9
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions pvlib/tests/iotools/test_panond.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
from pvlib.iotools import read_panond, parse_panond
from pvlib.tests.conftest import DATA_DIR
import io
# Not sure if I am creating these test scenarios correctly

fn_file = DATA_DIR / 'CPS SCH275KTL-DO-US-800-250kW_275kVA_1.OND'
ond_file = read_panond(fn_file)

fn_str = """PVObject_=pvGInverter
def test_read_ond_file():
fn_file = DATA_DIR / 'CPS SCH275KTL-DO-US-800-250kW_275kVA_1.OND'
ond_file = read_panond(fn_file)
# expected
fn_str = fn_str = """PVObject_=pvGInverter
Comment=ChintPower CPS SCH275KTL-DO/US-800 Manufacturer 2020
Version=6.81
ParObj1=2020
Expand Down Expand Up @@ -157,13 +158,16 @@
Night_Loss=5.00
End of PVObject pvGcomperter
"""
f_obj = io.StringIO(fn_str)
ond_str = parse_panond(f_obj)
f_obj = io.StringIO(fn_str)
ond_str = parse_panond(f_obj)
assert ond_file.keys() == ond_str.keys()

fn_file = DATA_DIR / 'ET-M772BH550GL.PAN'
mod_file = read_panond(fn_file)

fn_str = """PVObject_=pvModule
def test_read_pan_file():
fn_file = DATA_DIR / 'ET-M772BH550GL.PAN'
ond_file = read_panond(fn_file)
# expected
fn_str = """PVObject_=pvModule
Version=7.2
Flags=$00900243
Expand Down Expand Up @@ -239,5 +243,6 @@
End of PVObject pvIAM
End of PVObject pvModule
"""
f_obj = io.StringIO(fn_str)
mod_str = parse_panond(f_obj)
f_obj = io.StringIO(fn_str)
ond_str = parse_panond(f_obj)
assert ond_file.keys() == ond_str.keys()

0 comments on commit da5e7b9

Please sign in to comment.