def test_DefaultInstance(): assert ReplacementKernels.Get("asdf") is None myReplacement = ReplacementKernels.Get("Cijk_Alik_Bljk_SB_MT64x128x32_SE_1LDSB0_APM1_AF0EM8_AF1EM1_AMAS3_ASAE01_ASBE01_ASCE01_ASEM8_BL1_DTL0_DVO0_EPS1_FL0_GRVW4_GSU1_ISA908_IU1_K1_KLA_LBSPP0_LPA0_LPB0_LDL1_LRVW4_MDA2_NLCA1_NLCB1_ONLL1_PBD0_PK0_PGR1_PLR1_RK1_SIA1_SU32_SUM0_SUS256_SRVW0_SVW4_SNLL0_TT4_4_TLDS0_USFGRO1_VAW1_VS1_VW4_WSGRA0_WSGRB0_WG16_32_1_WGM8") assert os.path.isfile(myReplacement) assert os.path.isabs(myReplacement)
def test_DefaultInstance(): assert ReplacementKernels.Get("asdf") is None myReplacement = ReplacementKernels.Get( "Cijk_Ailk_Bjlk_DB_MT48x64x4_SE_APM1_AF0EM1_AF1EM1_AMAS3_ASBE01_ASEM1_BL1_DTL0_DVO0_EPS1_FL1_GRVW2_GSU1_ISA906_IU1_K1_KLA_LBSPP0_LPA0_LPB0_LDL1_NLCA1_NLCB1_ONLL1_PBD0_PK0_PGR1_PLR0_RK1_SIA1_SU0_SUM0_SUS256_SRVW0_SVW4_SNLL0_TT6_4_TLDS0_USFGRO0_VAW1_VS1_VW2_WSGRA0_WSGRB0_WG8_16_1_WGM4" ) assert os.path.isfile(myReplacement) assert os.path.isabs(myReplacement)
def test_DuplicateKernel(): with pytest.raises(RuntimeError): obj = ReplacementKernels(replacementDir('duplicate_kernel'), 'V3') obj.get("asdf")
def test_BadFile(): with pytest.raises(RuntimeError): obj = ReplacementKernels(replacementDir('bad_file'), 'V3') obj.get("asdf")
def test_BadFile(): with pytest.raises(RuntimeError): obj = ReplacementKernels(replacementDir('bad_file'), 'V3') obj.get("asdf") def test_DuplicateKernel(): with pytest.raises(RuntimeError): obj = ReplacementKernels(replacementDir('duplicate_kernel'), 'V3') obj.get("asdf") goodObjs = [ ReplacementKernels(replacementDir('known_kernels_v2'), "V2"), ReplacementKernels(replacementDir('known_kernels_v3'), "V3") ] @pytest.mark.parametrize("obj", goodObjs) def test_foo(obj): foo = obj.get('foo') assert os.path.isfile(foo) assert os.path.isabs(foo) assert foo.endswith('kernel_named_foo.txt') @pytest.mark.parametrize("obj", goodObjs) def test_bar(obj): bar = obj.get('bar')