def test_TexNode_getAttrValue(self): setupScene() nodesAttrsValues = [ ('fileNodeWithProjPath', 'ftn', getFxptLocation() + '/fxpt/fx_texture_manager/tests/testMayaProject/sourceimages/testTex_exit.png' ), ('fileNodeWithAbsPath', 'ftn', getFxptLocation() + '/fxpt/fx_texture_manager/icons/filter_active.png'), ('fileNodeWithEnvVar', 'ftn', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'), ('fileNodeWithInvalidEnvVar', 'ftn', '%INVALID_ENV_VAR%/fxpt/fx_texture_manager/icons/copy.png'), ('fileNodeWithNetworkPath', 'ftn', '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png' ), ('fileNodeWithInvalidPath', 'ftn', 'some/path/tex.png'), ('someNodeWithTextures1', 'texture', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'), ('someNodeWithTextures1', 'texture1', 'sourceimages/testTex_exit.png'), ('someNodeWithTextures1', 'texture2', '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png' ), ('someNodeWithTextures2', 'texture', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'), ('someNodeWithTextures2', 'texture1', 'sourceimages/testTex_exit.png'), ('someNodeWithTextures2', 'texture2', '') ] for node, attr, value in nodesAttrsValues: tn = tex_node.TexNode(node, attr) self.assertEqual(tn.getAttrValue(), value)
def setupScene(): meval( 'setProject "{}/fxpt/fx_texture_manager/tests/testMayaProject"'.format( getFxptLocation())) loadMayaScene( getFxptLocation() + '/fxpt/fx_texture_manager/tests/testMayaProject/scenes/testScene_01.mb' ) setFileNodeWithAbsPath() os.environ['FXPT_LOCATION'] = getFxptLocation()
def test_TexNode_getAttrValue(self): setupScene() nodesAttrsValues = [ ('fileNodeWithProjPath', 'ftn', getFxptLocation() + '/fxpt/fx_texture_manager/tests/testMayaProject/sourceimages/testTex_exit.png'), ('fileNodeWithAbsPath', 'ftn', getFxptLocation() + '/fxpt/fx_texture_manager/icons/filter_active.png'), ('fileNodeWithEnvVar', 'ftn', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'), ('fileNodeWithInvalidEnvVar', 'ftn', '%INVALID_ENV_VAR%/fxpt/fx_texture_manager/icons/copy.png'), ('fileNodeWithNetworkPath', 'ftn', '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png'), ('fileNodeWithInvalidPath', 'ftn', 'some/path/tex.png'), ('someNodeWithTextures1', 'texture', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'), ('someNodeWithTextures1', 'texture1', 'sourceimages/testTex_exit.png'), ('someNodeWithTextures1', 'texture2', '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png'), ('someNodeWithTextures2', 'texture', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'), ('someNodeWithTextures2', 'texture1', 'sourceimages/testTex_exit.png'), ('someNodeWithTextures2', 'texture2', '') ] for node, attr, value in nodesAttrsValues: tn = tex_node.TexNode(node, attr) self.assertEqual(tn.getAttrValue(), value)
def setFileNodeWithAbsPath(): m.setAttr('fileNodeWithAbsPath.ftn', getFxptLocation() + '/fxpt/fx_texture_manager/icons/filter_active.png', typ='string')
def setupScene(): meval('setProject "{}/fxpt/fx_texture_manager/tests/testMayaProject"'.format(getFxptLocation())) loadMayaScene(getFxptLocation() + '/fxpt/fx_texture_manager/tests/testMayaProject/scenes/testScene_01.mb') setFileNodeWithAbsPath() os.environ['FXPT_LOCATION'] = getFxptLocation()
def getTestEnvVar(): return 'FXPT_LOCATION', getFxptLocation()