# Path: eppy/modeleditor.py
# class NoObjectError(Exception):
# class NotSameObjectError(Exception):
# class IDDNotSetError(Exception):
# class IDDAlreadySetError(Exception):
# class IDF(object):
# def almostequal(first, second, places=7, printit=True):
# def poptrailing(lst):
# def extendlist(lst, i, value=""):
# def newrawobject(data, commdct, key, block=None, defaultvalues=True):
# def addthisbunch(bunchdt, data, commdct, thisbunch, theidf):
# def obj2bunch(data, commdct, obj):
# def namebunch(abunch, aname):
# def addobject(bunchdt, data, commdct, key, theidf, aname=None, **kwargs):
# def getnamedargs(*args, **kwargs):
# def addobject1(bunchdt, data, commdct, key, **kwargs):
# def getobject(bunchdt, key, name):
# def __objecthasfields(bunchdt, data, commdct, idfobject, places=7, **kwargs):
# def getobjects(bunchdt, data, commdct, key, places=7, **kwargs):
# def iddofobject(data, commdct, key):
# def getextensibleindex(bunchdt, data, commdct, key, objname):
# def removeextensibles(bunchdt, data, commdct, key, objname):
# def getfieldcomm(bunchdt, data, commdct, idfobject, fieldname):
# def is_retaincase(bunchdt, data, commdct, idfobject, fieldname):
# def isfieldvalue(bunchdt, data, commdct, idfobj, fieldname, value, places=7):
# def equalfield(bunchdt, data, commdct, idfobj1, idfobj2, fieldname, places=7):
# def getrefnames(idf, objname):
# def getallobjlists(idf, refname):
# def rename(idf, objkey, objname, newname):
# def zonearea(idf, zonename, debug=False):
# def zonearea_floor(idf, zonename, debug=False):
# def zonearea_roofceiling(idf, zonename, debug=False):
# def zone_height_min2max(idf, zonename, debug=False):
# def zoneheight(idf, zonename, debug=False):
# def zone_floor2roofheight(idf, zonename, debug=False):
# def zonevolume(idf, zonename):
# def refname2key(idf, refname):
#     def __init__(self, idfname=None, epw=None):
#     def setiddname(cls, iddname, testing=False):
#     def getiddname(cls):
#     def setidd(cls, iddinfo, iddindex, block, idd_version):
#     def initread(self, idfname):
#     def initreadtxt(self, idftxt):
#     def read(self):
#     def new(self, fname=None):
#     def initnew(self, fname):
#     def newidfobject(self, key, aname="", defaultvalues=True, **kwargs):
#     def popidfobject(self, key, index):
#     def removeidfobject(self, idfobject):
#     def removeallidfobjects(self, idfobject):
#     def copyidfobject(self, idfobject):
#     def getobject(self, key, name):
#     def getextensibleindex(self, key, name):
#     def removeextensibles(self, key, name):
#     def printidf(self):
#     def idfstr(self):
#     def save(self, filename=None, lineendings="default", encoding="latin-1"):
#     def saveas(self, filename, lineendings="default", encoding="latin-1"):
#     def savecopy(self, filename, lineendings="default", encoding="latin-1"):
#     def run(self, **kwargs):
#     def getiddgroupdict(self):
# 
# Path: eppy/pytest_helpers.py
# def do_integration_tests():
#     """
#     Check whether the 'EPPY_INTEGRATION' environment variable has been set to do
#     integration tests.
# 
#     Returns
#     -------
#     bool
# 
#     """
#     return os.getenv("EPPY_INTEGRATION", False)


import os
import pytest
import eppy
import eppy.easyopen as easyopen
import eppy.idd_helpers as idd_helpers
from eppy import modeleditor
from eppy.pytest_helpers import do_integration_tests
from six import StringIO
from importlib import reload
    not do_integration_tests(), reason="$EPPY_INTEGRATION env var not set"
)
def test_easyopen_idfopen():
    """py.test for easyopen"""
    ver = idd_helpers.latestidd()
    txt, result = ("  Version,{};".format(ver), "{}".format(ver))
    fhandle1 = StringIO(txt)
    fhandle2 = StringIO(txt)
    reload(eppy)
    reload(modeleditor)
    reload(easyopen)
    idf1, idf2 = easyopen.easyopen(fhandle1), eppy.openidf(fhandle2)
    for idf in [idf1, idf2]:
        versions = idf.idfobjects["version"]
        version = versions[0]
        ver = version.Version_Identifier
        assert result == ver
    # test with epw=weatherfile
    fhandle1 = StringIO(txt)
    fhandle2 = StringIO(txt)
    epwname = "weatherfile.epw"
    idf1, idf2 = (
        easyopen.easyopen(fhandle1, epw=epwname),
        eppy.openidf(fhandle2, epw=epwname),
    )
    for idf in [idf1, idf2]:
        assert idf.epw == epwname


@pytest.mark.skipif(

# Path: eppy/modeleditor.py
# class NoObjectError(Exception):
# class NotSameObjectError(Exception):
# class IDDNotSetError(Exception):
# class IDDAlreadySetError(Exception):
# class IDF(object):
# def almostequal(first, second, places=7, printit=True):
# def poptrailing(lst):
# def extendlist(lst, i, value=""):
# def newrawobject(data, commdct, key, block=None, defaultvalues=True):
# def addthisbunch(bunchdt, data, commdct, thisbunch, theidf):
# def obj2bunch(data, commdct, obj):
# def namebunch(abunch, aname):
# def addobject(bunchdt, data, commdct, key, theidf, aname=None, **kwargs):
# def getnamedargs(*args, **kwargs):
# def addobject1(bunchdt, data, commdct, key, **kwargs):
# def getobject(bunchdt, key, name):
# def __objecthasfields(bunchdt, data, commdct, idfobject, places=7, **kwargs):
# def getobjects(bunchdt, data, commdct, key, places=7, **kwargs):
# def iddofobject(data, commdct, key):
# def getextensibleindex(bunchdt, data, commdct, key, objname):
# def removeextensibles(bunchdt, data, commdct, key, objname):
# def getfieldcomm(bunchdt, data, commdct, idfobject, fieldname):
# def is_retaincase(bunchdt, data, commdct, idfobject, fieldname):
# def isfieldvalue(bunchdt, data, commdct, idfobj, fieldname, value, places=7):
# def equalfield(bunchdt, data, commdct, idfobj1, idfobj2, fieldname, places=7):
# def getrefnames(idf, objname):
# def getallobjlists(idf, refname):
# def rename(idf, objkey, objname, newname):
# def zonearea(idf, zonename, debug=False):
# def zonearea_floor(idf, zonename, debug=False):
# def zonearea_roofceiling(idf, zonename, debug=False):
# def zone_height_min2max(idf, zonename, debug=False):
# def zoneheight(idf, zonename, debug=False):
# def zone_floor2roofheight(idf, zonename, debug=False):
# def zonevolume(idf, zonename):
# def refname2key(idf, refname):
#     def __init__(self, idfname=None, epw=None):
#     def setiddname(cls, iddname, testing=False):
#     def getiddname(cls):
#     def setidd(cls, iddinfo, iddindex, block, idd_version):
#     def initread(self, idfname):
#     def initreadtxt(self, idftxt):
#     def read(self):
#     def new(self, fname=None):
#     def initnew(self, fname):
#     def newidfobject(self, key, aname="", defaultvalues=True, **kwargs):
#     def popidfobject(self, key, index):
#     def removeidfobject(self, idfobject):
#     def removeallidfobjects(self, idfobject):
#     def copyidfobject(self, idfobject):
#     def getobject(self, key, name):
#     def getextensibleindex(self, key, name):
#     def removeextensibles(self, key, name):
#     def printidf(self):
#     def idfstr(self):
#     def save(self, filename=None, lineendings="default", encoding="latin-1"):
#     def saveas(self, filename, lineendings="default", encoding="latin-1"):
#     def savecopy(self, filename, lineendings="default", encoding="latin-1"):
#     def run(self, **kwargs):
#     def getiddgroupdict(self):
# 
# Path: eppy/pytest_helpers.py
# def do_integration_tests():
#     """
#     Check whether the 'EPPY_INTEGRATION' environment variable has been set to do
#     integration tests.
# 
#     Returns
#     -------
#     bool
# 
#     """
#     return os.getenv("EPPY_INTEGRATION", False)


# Path: tests/test_easyopen.py
import os
import pytest
import eppy
import eppy.easyopen as easyopen
import eppy.idd_helpers as idd_helpers
from eppy import modeleditor
from eppy.pytest_helpers import do_integration_tests
from six import StringIO
from importlib import reload

    not do_integration_tests(), reason="$EPPY_INTEGRATION env var not set"
)
def test_easyopen_idfopen():
    """py.test for easyopen"""
    ver = idd_helpers.latestidd()
    txt, result = ("  Version,{};".format(ver), "{}".format(ver))
    fhandle1 = StringIO(txt)
    fhandle2 = StringIO(txt)
    reload(eppy)
    reload(modeleditor)
    reload(easyopen)
    idf1, idf2 = easyopen.easyopen(fhandle1), eppy.openidf(fhandle2)
    for idf in [idf1, idf2]:
        versions = idf.idfobjects["version"]
        version = versions[0]
        ver = version.Version_Identifier
        assert result == ver
    # test with epw=weatherfile
    fhandle1 = StringIO(txt)
    fhandle2 = StringIO(txt)
    epwname = "weatherfile.epw"
    idf1, idf2 = (
        easyopen.easyopen(fhandle1, epw=epwname),
        eppy.openidf(fhandle2, epw=epwname),
    )
    for idf in [idf1, idf2]:
        assert idf.epw == epwname


@pytest.mark.skipif(

    not do_integration_tests(), reason="$EPPY_INTEGRATION env var not set"