@@ -875,66 +875,88 @@ def test08_holds_constructions(self):
875875 model = model .get ()
876876 mdl = openstudio .model .Model ()
877877
878- t1 = "roofceiling"
879- t2 = "wall"
880- cl1 = openstudio .model .DefaultConstructionSet
881- cl2 = openstudio .model .LayeredConstruction
882- id1 = cl1 .__name__
883- id2 = cl2 .__name__
884- n1 = "CBECS Before-1980 ClimateZone 8 (smoff) ConstSet"
885- n2 = "CBECS Before-1980 ExtRoof IEAD ClimateZone 8"
886- m5 = "Invalid 'surface type' arg #5 (osut.holdsConstruction)"
887- m6 = "'set' LayeredConstruction? expecting DefaultConstructionSet"
888- m7 = "'set' Model? expecting DefaultConstructionSet"
889- set = model .getDefaultConstructionSetByName (n1 )
890- c = model .getLayeredConstructionByName (n2 )
878+ # cl1 = openstudio.model.DefaultConstructionSet
879+ # cl2 = openstudio.model.LayeredConstruction
880+ # cl2 = openstudio.model.Construction
881+ # id1 = cl1.__name__
882+ # id2 = cl2.__name__
883+ # id3 = cl3.__name__
884+
885+ t1 = "RoofCeiling"
886+ t2 = "Wall"
887+ t3 = "Floor"
888+ t4 = "FixedWindow"
889+ n0 = "CBECS Before-1980 ClimateZone 8 (smoff) ConstSet"
890+ n1 = "CBECS Before-1980 ExtRoof IEAD ClimateZone 8"
891+ n2 = "CBECS Before-1980 ExtWall Mass ClimateZone 8"
892+ n3 = "000 ExtSlabCarpet 4in ClimateZone 1-8"
893+ n4 = "CBECS Before-1980 ExtWindow ClimateZone 5-8"
894+ m1 = "Invalid 'surface type' arg #5 (osut.holdsConstruction)"
895+ m2 = "'set' LayeredConstruction? expecting DefaultConstructionSet"
896+ m3 = "'set' Model? expecting DefaultConstructionSet"
897+
898+ set = model .getDefaultConstructionSetByName (n0 )
899+ c1 = model .getLayeredConstructionByName (n1 )
900+ c2 = model .getLayeredConstructionByName (n2 )
901+ c3 = model .getLayeredConstructionByName (n3 )
902+ c4 = model .getLayeredConstructionByName (n4 )
891903 self .assertTrue (set )
892- self .assertTrue (c )
904+ self .assertTrue (c1 )
905+ self .assertTrue (c2 )
906+ self .assertTrue (c3 )
907+ self .assertTrue (c4 )
893908 set = set .get ()
894- c = c .get ()
909+ c1 = c1 .get ()
910+ c2 = c2 .get ()
911+ c3 = c3 .get ()
912+ c4 = c4 .get ()
895913
896- # TRUE case: 'set' holds 'c' (exterior roofceiling construction).
897- answer = osut .holdsConstruction (set , c , False , True , t1 )
898- self .assertTrue (osut .holdsConstruction (set , c , False , True , t1 ))
899- self .assertEqual (o .status (), 0 )
914+ # TRUE cases:
915+ self .assertTrue (osut .holdsConstruction (set , c1 , False , True , t1 ))
916+ self .assertTrue (osut .holdsConstruction (set , c2 , False , True , t2 ))
917+ self .assertTrue (osut .holdsConstruction (set , c3 , True , False , t3 ))
918+ self .assertTrue (osut .holdsConstruction (set , c4 , False , True , t4 ))
919+
920+ # FALSE case: roofceiling as ground roof construction.
921+ self .assertFalse (osut .holdsConstruction (set , c1 , True , False , t1 ))
900922
901- # FALSE case: not ground construction .
902- self .assertFalse (osut .holdsConstruction (set , c , True , True , t1 ))
923+ # FALSE case: ground-facing sub subsurface .
924+ self .assertFalse (osut .holdsConstruction (set , c4 , True , False , t4 ))
903925 self .assertEqual (o .status (), 0 )
904926
905- # INVALID case: arg #5 : None (instead of surface type string).
906- self .assertFalse (osut .holdsConstruction (set , c , True , True , None ))
927+ # INVALID case: arg #1 : None (instead of surface type string).
928+ self .assertFalse (osut .holdsConstruction (set , c1 , False , True , None ))
907929 self .assertTrue (o .is_debug ())
908930 self .assertEqual (len (o .logs ()), 1 )
909- self .assertEqual (o .logs ()[0 ]["message" ], m5 )
931+ self .assertEqual (o .logs ()[0 ]["message" ], m1 )
910932 self .assertEqual (o .clean (), DBG )
911933
912- # INVALID case: arg #5 : empty surface type string.
913- self .assertFalse (osut .holdsConstruction (set , c , True , True , "" ))
934+ # INVALID case: arg #2 : empty surface type string.
935+ self .assertFalse (osut .holdsConstruction (set , c1 , False , True , "" ))
914936 self .assertTrue (o .is_debug ())
915937 self .assertEqual (len (o .logs ()), 1 )
916- self .assertEqual (o .logs ()[0 ]["message" ], m5 )
938+ self .assertEqual (o .logs ()[0 ]["message" ], m1 )
917939 self .assertEqual (o .clean (), DBG )
918940
919- # INVALID case: arg #5 : c construction (instead of surface type string).
920- self .assertFalse (osut .holdsConstruction (set , c , True , True , c ))
941+ # INVALID case: arg #3 : construction (instead of surface type string).
942+ self .assertFalse (osut .holdsConstruction (set , c1 , False , True , c2 ))
921943 self .assertTrue (o .is_debug ())
922944 self .assertEqual (len (o .logs ()), 1 )
923- self .assertEqual (o .logs ()[0 ]["message" ], m5 )
945+ self .assertEqual (o .logs ()[0 ]["message" ], m1 )
924946 self .assertEqual (o .clean (), DBG )
925947
926- # INVALID case: arg #1 : c construction (instead of surface type string ).
927- self .assertFalse (osut .holdsConstruction (c , c , True , True , c ))
948+ # INVALID case: arg #4 : construction (instead of set ).
949+ self .assertFalse (osut .holdsConstruction (c2 , c1 , False , True , t1 ))
928950 self .assertTrue (o .is_debug ())
929951 self .assertEqual (len (o .logs ()), 1 )
930- self .assertTrue (m6 in o .logs ()[0 ]["message" ])
952+ self .assertTrue (m2 in o .logs ()[0 ]["message" ])
931953 self .assertEqual (o .clean (), DBG )
932954
933- # INVALID case: arg #1 : model (instead of surface type string ).
934- self .assertFalse (osut .holdsConstruction (mdl , c , True , True , t1 ))
955+ # INVALID case: arg #5 : model (instead of set ).
956+ self .assertFalse (osut .holdsConstruction (mdl , c1 , False , True , t1 ))
935957 self .assertTrue (o .is_debug ())
936958 self .assertEqual (len (o .logs ()), 1 )
937- self .assertTrue (m7 in o .logs ()[0 ]["message" ])
959+ self .assertTrue (m3 in o .logs ()[0 ]["message" ])
938960 self .assertEqual (o .clean (), DBG )
939961
940962 del (model )
0 commit comments