# Path: ship/utils/fileloaders/fileloader.py
# class FileLoader(object):
#     def __init__(self):
#     def loadFile(self, filepath, arg_dict={}):
# 
# Path: ship/tuflow/tuflowfactory.py
# class TuflowFactory(object):
#     def getTuflowPart(cls, line, parent, part_type=None, logic=None):
#     def createModelVariableType(line, parent, **kwargs):
#     def createUserVariableType(line, parent, **kwargs):
#     def createBcEventVariable(line, parent, **kwargs):
#     def createVariableType(line, parent, **kwargs):
#     def createKeyValueType(line, parent, **kwargs):
#     def createDataType(line, parent, **kwargs):
#     def createResultType(line, parent, **kwargs):
#     def createGisType(line, parent, **kwargs):
#     def createModelType(line, parent, **kwargs):
#     def createIfLogic(parent, commands, terms, comments):
#     def createBlockLogic(parent, commands, terms, comments):
# def partsFromPipedFiles(part_type, parent, **kwargs):
# def assignSiblings(parts):
# def checkMultiTypes(line, part_type):
# def checkEstryAuto(line, parent):
# def checkIsComment(line):
# def takeParentType(path):
# def getExtension(path, upper=True):
# def breakLine(line):
# def separateComment(instruction):
# def resolveResult(result_part):
# 
# Path: integration_tests/utils.py
# def softAssertion(var, value, testEqual=True):
# def softAssertionIn(var, value, testIn=True):


import os
import copy
from ship.utils.fileloaders import fileloader
from ship.tuflow import tuflowfactory as factory
from integration_tests import utils
        zpt_part = control.contains(command="Set Zpts", variable="2",
                                    parent_filename="test_trd2")
        zln_part = control.contains(command="Z Line THIN", filename="zln_shiptest_trd_v2")
        parts = zpt_part + zln_part
        utils.softAssertion(len(parts), 3)

        trd = control.contains(filename="test_trd2")[0]
        trd.active = False

        # Then check after
        zpt_part = control.contains(command="Set Zpts", variable="2",
                                    parent_filename="test_trd2")
        zln_part = control.contains(command="Z Line THIN", filename="zln_shiptest_trd_v2")
        parts = zpt_part + zln_part
        utils.softAssertion(len(parts), 0)
        
        print ('Done')

    def test_addPartToPartHolder(self):
        print ('Testing add part to PartHolder...')
#         tuflow = copy.deepcopy(self.tuflow)
        tuflow = self.tuflow
        control = tuflow.control_files['TGC']
        tgc = None
        for c in control.control_files:
            if c.filename == 'test_tgc1': tgc = c
        
        line = "Timestep == 12 ! timestep 12 comment"
        varpart = factory.TuflowFactory.getTuflowPart(line, tgc)[0]
        line2 = "Timestep == 22 ! timestep 22 comment"

# Path: ship/utils/fileloaders/fileloader.py
# class FileLoader(object):
#     def __init__(self):
#     def loadFile(self, filepath, arg_dict={}):
# 
# Path: ship/tuflow/tuflowfactory.py
# class TuflowFactory(object):
#     def getTuflowPart(cls, line, parent, part_type=None, logic=None):
#     def createModelVariableType(line, parent, **kwargs):
#     def createUserVariableType(line, parent, **kwargs):
#     def createBcEventVariable(line, parent, **kwargs):
#     def createVariableType(line, parent, **kwargs):
#     def createKeyValueType(line, parent, **kwargs):
#     def createDataType(line, parent, **kwargs):
#     def createResultType(line, parent, **kwargs):
#     def createGisType(line, parent, **kwargs):
#     def createModelType(line, parent, **kwargs):
#     def createIfLogic(parent, commands, terms, comments):
#     def createBlockLogic(parent, commands, terms, comments):
# def partsFromPipedFiles(part_type, parent, **kwargs):
# def assignSiblings(parts):
# def checkMultiTypes(line, part_type):
# def checkEstryAuto(line, parent):
# def checkIsComment(line):
# def takeParentType(path):
# def getExtension(path, upper=True):
# def breakLine(line):
# def separateComment(instruction):
# def resolveResult(result_part):
# 
# Path: integration_tests/utils.py
# def softAssertion(var, value, testEqual=True):
# def softAssertionIn(var, value, testIn=True):


# Path: integration_tests/test_tuflowupdate.py
import os
import copy
from ship.utils.fileloaders import fileloader
from ship.tuflow import tuflowfactory as factory
from integration_tests import utils

        zpt_part = control.contains(command="Set Zpts", variable="2",
                                    parent_filename="test_trd2")
        zln_part = control.contains(command="Z Line THIN", filename="zln_shiptest_trd_v2")
        parts = zpt_part + zln_part
        utils.softAssertion(len(parts), 3)

        trd = control.contains(filename="test_trd2")[0]
        trd.active = False

        # Then check after
        zpt_part = control.contains(command="Set Zpts", variable="2",
                                    parent_filename="test_trd2")
        zln_part = control.contains(command="Z Line THIN", filename="zln_shiptest_trd_v2")
        parts = zpt_part + zln_part
        utils.softAssertion(len(parts), 0)
        
        print ('Done')

    def test_addPartToPartHolder(self):
        print ('Testing add part to PartHolder...')
#         tuflow = copy.deepcopy(self.tuflow)
        tuflow = self.tuflow
        control = tuflow.control_files['TGC']
        tgc = None
        for c in control.control_files:
            if c.filename == 'test_tgc1': tgc = c
        
        line = "Timestep == 12 ! timestep 12 comment"
        varpart = factory.TuflowFactory.getTuflowPart(line, tgc)[0]
        line2 = "Timestep == 22 ! timestep 22 comment"

        varpart2 = factory.TuflowFactory.getTuflowPart(line2, tgc)[0]