How to use read_log method in robotframework-pageobjects

Best Python code snippet using robotframework-pageobjects_python

feature_test.py

Source:feature_test.py Github

copy

Full Screen

...6import unittest7from vmaf.config import VmafConfig8from vmaf import ExternalProgram9REMOVE_LOG = 1 # for debug, make this 010def read_log(log_filename, type):11 scores = []12 idx = 013 with open(log_filename, 'rt') as log_file:14 for line in log_file.readlines():15 mo = re.match("{type}: ([0-9]+) ([0-9.-]+)".format(type=type), line)16 if mo:17 cur_idx = int(mo.group(1))18 assert cur_idx == idx19 scores.append(float(mo.group(2)))20 idx += 121 score = sum(scores) / float(len(scores))22 return score, scores23class FeatureTest(unittest.TestCase):24 LOG_FILENAME = VmafConfig.workdir_path("logFeatureTest")25 REF_YUV = VmafConfig.test_resource_path("yuv", "src01_hrc00_576x324.yuv")26 DIS_YUV = VmafConfig.test_resource_path("yuv", "src01_hrc01_576x324.yuv")27 YUV_FMT = "yuv420p"28 YUV_WIDTH = 57629 YUV_HEIGHT = 32430 def setUp(self):31 if os.path.exists(self.LOG_FILENAME):32 os.remove(self.LOG_FILENAME)33 def tearDown(self):34 if os.path.exists(self.LOG_FILENAME):35 os.remove(self.LOG_FILENAME)36 if(REMOVE_LOG):37 (logPath, logFilePrefix) = os.path.split(self.LOG_FILENAME)38 filenames = [filename for filename in os.listdir(logPath) if filename.startswith(logFilePrefix)]39 for filename in filenames:40 os.remove(os.path.join(logPath, filename))41 def test_adm(self):42 ADM_LOG = self.LOG_FILENAME + '_adm'43 print 'test adm...'44 cmd = "{vmaf} adm {fmt} {ref} {dis} {w} {h} > {log}".format(45 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,46 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=ADM_LOG47 )48 run_process(cmd, shell=True)49 score, scores = read_log(ADM_LOG, "adm")50 self.assertAlmostEquals(score, 0.9345877708333336, places=4)51 score, scores = read_log(ADM_LOG, "adm_num")52 self.assertAlmostEquals(score, 371.8354140624999, places=4)53 score, scores = read_log(ADM_LOG, "adm_den")54 self.assertAlmostEquals(score, 397.8337897291667, places=4)55 score, scores = read_log(ADM_LOG, "adm_num_scale0")56 self.assertAlmostEquals(score, 45.5277493125, places=4)57 score, scores = read_log(ADM_LOG, "adm_den_scale0")58 self.assertAlmostEquals(score, 50.143851375000004, places=4)59 score, scores = read_log(ADM_LOG, "adm_num_scale1")60 self.assertAlmostEquals(score, 66.58064533333334, places=4)61 score, scores = read_log(ADM_LOG, "adm_den_scale1")62 self.assertAlmostEquals(score, 74.47438285416666, places=4)63 score, scores = read_log(ADM_LOG, "adm_num_scale2")64 self.assertAlmostEquals(score, 105.56477879166668, places=4)65 score, scores = read_log(ADM_LOG, "adm_den_scale2")66 self.assertAlmostEquals(score, 113.49725852083333, places=4)67 score, scores = read_log(ADM_LOG, "adm_num_scale3")68 self.assertAlmostEquals(score, 154.16224066666666, places=4)69 score, scores = read_log(ADM_LOG, "adm_den_scale3")70 self.assertAlmostEquals(score, 159.71829710416668, places=4)71 def test_ansnr(self):72 ANSNR_LOG = self.LOG_FILENAME + '_ansnr'73 print 'test ansnr...'74 cmd = "{vmaf} ansnr {fmt} {ref} {dis} {w} {h} > {log}".format(75 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,76 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=ANSNR_LOG77 )78 run_process(cmd, shell=True)79 score, scores = read_log(ANSNR_LOG, "ansnr")80 self.assertAlmostEquals(score, 23.5095715208, places=4)81 score, scores = read_log(ANSNR_LOG, "anpsnr")82 self.assertAlmostEquals(score, 34.164776875, places=4)83 def test_motion(self):84 MOTION_LOG = self.LOG_FILENAME + '_motion'85 print 'test motion...'86 cmd = "{vmaf} motion {fmt} {ref} {dis} {w} {h} > {log}".format(87 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,88 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=MOTION_LOG89 )90 run_process(cmd, shell=True)91 score, scores = read_log(MOTION_LOG, "motion")92 self.assertAlmostEquals(score, 4.04982535417, places=4)93 def test_vif(self):94 VIF_LOG = self.LOG_FILENAME + '_vif'95 print 'test vif...'96 cmd = "{vmaf} vif {fmt} {ref} {dis} {w} {h} > {log}".format(97 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,98 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=VIF_LOG99 )100 run_process(cmd, shell=True)101 score, scores = read_log(VIF_LOG, "vif")102 self.assertAlmostEquals(score, 0.4460930625000001, places=4)103 self.assertAlmostEquals(scores[0], 0.580304, places=4)104 self.assertAlmostEquals(scores[1], 0.492477, places=4)105 score, scores = read_log(VIF_LOG, "vif_num")106 self.assertAlmostEquals(score, 712650.023478, places=0)107 score, scores = read_log(VIF_LOG, "vif_den")108 self.assertAlmostEquals(score, 1597314.95249, places=0)109 score, scores = read_log(VIF_LOG, "vif_num_scale0")110 self.assertAlmostEquals(score, 468101.509766, places=0)111 score, scores = read_log(VIF_LOG, "vif_num_scale1")112 self.assertAlmostEquals(score, 184971.572266, places=1)113 score, scores = read_log(VIF_LOG, "vif_num_scale2")114 self.assertAlmostEquals(score, 47588.8323567, places=0)115 score, scores = read_log(VIF_LOG, "vif_num_scale3")116 self.assertAlmostEquals(score, 11988.1090902, places=1)117 score, scores = read_log(VIF_LOG, "vif_den_scale0")118 self.assertAlmostEquals(score, 1287822.80208, places=0)119 score, scores = read_log(VIF_LOG, "vif_den_scale1")120 self.assertAlmostEquals(score, 241255.067708, places=1)121 score, scores = read_log(VIF_LOG, "vif_den_scale2")122 self.assertAlmostEquals(score, 55149.8169759, places=2)123 score, scores = read_log(VIF_LOG, "vif_den_scale3")124 self.assertAlmostEquals(score, 13087.2657267, places=2)125 def test_all(self):126 ALL_LOG = self.LOG_FILENAME + "_all"127 print 'test all...'128 cmd = "{vmaf} all {fmt} {ref} {dis} {w} {h} > {log}".format(129 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,130 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=ALL_LOG131 )132 run_process(cmd, shell=True)133 score, scores = read_log(ALL_LOG, "vif")134 self.assertAlmostEquals(score, 0.4460930625, places=4)135 score, scores = read_log(ALL_LOG, "motion")136 self.assertAlmostEquals(score, 4.04982535417, places=4)137 score, scores = read_log(ALL_LOG, "ansnr")138 self.assertAlmostEquals(score, 23.509571520833337, places=4)139 score, scores = read_log(ALL_LOG, "adm")140 self.assertAlmostEquals(score, 0.9345877708333336, places=4)141 score, scores = read_log(ALL_LOG, "adm_num")142 self.assertAlmostEquals(score, 371.8354140624999, places=4)143 score, scores = read_log(ALL_LOG, "adm_den")144 self.assertAlmostEquals(score, 397.8337897291667, places=4)145 score, scores = read_log(ALL_LOG, "vif_num")146 self.assertAlmostEquals(score, 712650.023478, places=0)147 score, scores = read_log(ALL_LOG, "vif_den")148 self.assertAlmostEquals(score, 1597314.95249, places=0)149 score, scores = read_log(ALL_LOG, "anpsnr")150 self.assertAlmostEquals(score, 34.164776874999994, places=4)151 score, scores = read_log(ALL_LOG, "vif_num_scale0")152 self.assertAlmostEquals(score, 468101.509766, places=0)153 score, scores = read_log(ALL_LOG, "vif_num_scale1")154 self.assertAlmostEquals(score, 184971.572266, places=1)155 score, scores = read_log(ALL_LOG, "vif_num_scale2")156 self.assertAlmostEquals(score, 47588.8323567, places=0)157 score, scores = read_log(ALL_LOG, "vif_num_scale3")158 self.assertAlmostEquals(score, 11988.1090902, places=1)159 score, scores = read_log(ALL_LOG, "vif_den_scale0")160 self.assertAlmostEquals(score, 1287822.80208, places=0)161 score, scores = read_log(ALL_LOG, "vif_den_scale1")162 self.assertAlmostEquals(score, 241255.067708, places=1)163 score, scores = read_log(ALL_LOG, "vif_den_scale2")164 self.assertAlmostEquals(score, 55149.8169759, places=2)165 score, scores = read_log(ALL_LOG, "vif_den_scale3")166 self.assertAlmostEquals(score, 13087.2657267, places=2)167 score, scores = read_log(ALL_LOG, "adm_den_scale0")168 self.assertAlmostEquals(score, 50.143851375000004, places=4)169 score, scores = read_log(ALL_LOG, "adm_num_scale1")170 self.assertAlmostEquals(score, 66.58064533333334, places=4)171 score, scores = read_log(ALL_LOG, "adm_den_scale1")172 self.assertAlmostEquals(score, 74.47438285416666, places=4)173 score, scores = read_log(ALL_LOG, "adm_num_scale2")174 self.assertAlmostEquals(score, 105.56477879166668, places=4)175 score, scores = read_log(ALL_LOG, "adm_den_scale2")176 self.assertAlmostEquals(score, 113.49725852083333, places=4)177 score, scores = read_log(ALL_LOG, "adm_num_scale3")178 self.assertAlmostEquals(score, 154.16224066666666, places=4)179 score, scores = read_log(ALL_LOG, "adm_den_scale3")180 self.assertAlmostEquals(score, 159.71829710416668, places=4)181 def test_psnr(self):182 PSNR_LOG = self.LOG_FILENAME + '_psnr'183 print 'test psnr...'184 cmd = "{psnr} {fmt} {ref} {dis} {w} {h} > {log}".format(185 psnr=ExternalProgram.psnr, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,186 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=PSNR_LOG187 )188 run_process(cmd, shell=True)189 score, scores = read_log(PSNR_LOG, "psnr")190 self.assertAlmostEquals(score, 30.7550639792, places=4)191 self.assertAlmostEquals(scores[0], 34.760779, places=4)192 self.assertAlmostEquals(scores[1], 31.88322, places=4)193 def test_2nd_moment(self):194 MOMENT_LOG = self.LOG_FILENAME + '_moment'195 print 'test 2nd moment...'196 cmd = "{moment} 2 {fmt} {dis} {w} {h} > {log}".format(197 moment=ExternalProgram.moment, fmt=self.YUV_FMT, dis=self.DIS_YUV,198 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=MOMENT_LOG199 )200 run_process(cmd, shell=True)201 score, scores = read_log(MOMENT_LOG, "1stmoment")202 self.assertAlmostEquals(score, 61.332006624999984, places=4)203 score, scores = read_log(MOMENT_LOG, "2ndmoment")204 self.assertAlmostEquals(score, 4798.659574041666, places=4)205 def test_ssim(self):206 SSIM_LOG = self.LOG_FILENAME + '_ssim'207 print 'test ssim...'208 cmd = "{ssim} {fmt} {ref} {dis} {w} {h} > {log}".format(209 ssim=ExternalProgram.ssim, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,210 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=SSIM_LOG211 )212 run_process(cmd, shell=True)213 score, scores = read_log(SSIM_LOG, "ssim")214 self.assertAlmostEquals(score, 0.863226541666667, places=4)215 self.assertAlmostEquals(scores[0], 0.925023, places=4)216 self.assertAlmostEquals(scores[1], 0.891992, places=4)217 score, scores = read_log(SSIM_LOG, "ssim_l")218 self.assertAlmostEquals(score, 0.998147458333333, places=4)219 self.assertAlmostEquals(scores[0], 0.999524, places=4)220 self.assertAlmostEquals(scores[1], 0.998983, places=4)221 score, scores = read_log(SSIM_LOG, "ssim_c")222 self.assertAlmostEquals(score, 0.9612679375000001, places=4)223 self.assertAlmostEquals(scores[0], 0.979614, places=4)224 self.assertAlmostEquals(scores[1], 0.96981, places=4)225 score, scores = read_log(SSIM_LOG, "ssim_s")226 self.assertAlmostEquals(score, 0.8977363333333335, places=4)227 self.assertAlmostEquals(scores[0], 0.943966, places=4)228 self.assertAlmostEquals(scores[1], 0.919507, places=4)229 def test_ms_ssim(self):230 MS_SSIM_LOG = self.LOG_FILENAME + '_msssim'231 print 'test ms_ssim...'232 cmd = "{ms_ssim} {fmt} {ref} {dis} {w} {h} > {log}".format(233 ms_ssim=ExternalProgram.ms_ssim, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,234 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=MS_SSIM_LOG235 )236 run_process(cmd, shell=True)237 score, scores = read_log(MS_SSIM_LOG, "ms_ssim")238 self.assertAlmostEquals(score, 0.9632498125, places=4)239 self.assertAlmostEquals(scores[0], 0.981968, places=4)240 self.assertAlmostEquals(scores[1], 0.973366, places=4)241 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale0")242 self.assertAlmostEquals(score, 0.998147458333333, places=4)243 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale0")244 self.assertAlmostEquals(score, 0.9612679375000001, places=4)245 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale0")246 self.assertAlmostEquals(score, 0.8977363333333335, places=4)247 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale1")248 self.assertAlmostEquals(score, 0.9989961250000002, places=4)249 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale1")250 self.assertAlmostEquals(score, 0.9857694375, places=4)251 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale1")252 self.assertAlmostEquals(score, 0.941185875, places=4)253 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale2")254 self.assertAlmostEquals(score, 0.9992356458333332, places=4)255 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale2")256 self.assertAlmostEquals(score, 0.997034020833, places=4)257 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale2")258 self.assertAlmostEquals(score, 0.977992145833, places=4)259 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale3")260 self.assertAlmostEquals(score, 0.9992921041666665, places=4)261 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale3")262 self.assertAlmostEquals(score, 0.999588104167, places=4)263 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale3")264 self.assertAlmostEquals(score, 0.99387125, places=4)265 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale4")266 self.assertAlmostEquals(score, 0.9994035625000003, places=4)267 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale4")268 self.assertAlmostEquals(score, 0.999907625, places=4)269 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale4")270 self.assertAlmostEquals(score, 0.998222583333, places=4)271class FeatureTestYuv422p10le(unittest.TestCase):272 LOG_FILENAME = VmafConfig.workdir_path("logFeatureTestYuv422p10le")273 REF_YUV = VmafConfig.test_resource_path("yuv", "src01_hrc00_576x324.yuv422p10le.yuv")274 DIS_YUV = VmafConfig.test_resource_path("yuv", "src01_hrc01_576x324.yuv422p10le.yuv")275 YUV_FMT = "yuv422p10le"276 YUV_WIDTH = 576277 YUV_HEIGHT = 324278 def setUp(self):279 if os.path.exists(self.LOG_FILENAME):280 os.remove(self.LOG_FILENAME)281 def tearDown(self):282 if os.path.exists(self.LOG_FILENAME):283 os.remove(self.LOG_FILENAME)284 if (REMOVE_LOG):285 (logPath, logFilePrefix) = os.path.split(self.LOG_FILENAME)286 filenames = [filename for filename in os.listdir(logPath) if filename.startswith(logFilePrefix)]287 for filename in filenames:288 os.remove(os.path.join(logPath, filename))289 def test_adm(self):290 ADM_LOG = self.LOG_FILENAME + '_adm'291 print 'test adm on yuv422p10le...'292 cmd = "{vmaf} adm {fmt} {ref} {dis} {w} {h} > {log}".format(293 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,294 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=ADM_LOG295 )296 run_process(cmd, shell=True)297 score, scores = read_log(ADM_LOG, "adm")298 self.assertAlmostEquals(score, 0.9345877708333336, places=4)299 score, scores = read_log(ADM_LOG, "adm_num")300 self.assertAlmostEquals(score, 371.8354140624999, places=4)301 score, scores = read_log(ADM_LOG, "adm_den")302 self.assertAlmostEquals(score, 397.8337897291667, places=4)303 score, scores = read_log(ADM_LOG, "adm_den_scale0")304 self.assertAlmostEquals(score, 50.143851375000004, places=4)305 score, scores = read_log(ADM_LOG, "adm_num_scale1")306 self.assertAlmostEquals(score, 66.58064533333334, places=4)307 score, scores = read_log(ADM_LOG, "adm_den_scale1")308 self.assertAlmostEquals(score, 74.47438285416666, places=4)309 score, scores = read_log(ADM_LOG, "adm_num_scale2")310 self.assertAlmostEquals(score, 105.56477879166668, places=4)311 score, scores = read_log(ADM_LOG, "adm_den_scale2")312 self.assertAlmostEquals(score, 113.49725852083333, places=4)313 score, scores = read_log(ADM_LOG, "adm_num_scale3")314 self.assertAlmostEquals(score, 154.16224066666666, places=4)315 score, scores = read_log(ADM_LOG, "adm_den_scale3")316 self.assertAlmostEquals(score, 159.71829710416668, places=4)317 def test_ansnr(self):318 ANSNR_LOG = self. LOG_FILENAME + '_ansnr'319 print 'test ansnr on yuv422p10le...'320 cmd = "{vmaf} ansnr {fmt} {ref} {dis} {w} {h} > {log}".format(321 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,322 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=ANSNR_LOG323 )324 run_process(cmd, shell=True)325 score, scores = read_log(ANSNR_LOG, "ansnr")326 self.assertAlmostEquals(score, 23.5095715208, places=4)327 score, scores = read_log(ANSNR_LOG, "anpsnr")328 self.assertAlmostEquals(score, 34.1902860625, places=4)329 def test_motion(self):330 MOTION_LOG = self.LOG_FILENAME + '_motion'331 print 'test motion on yuv422p10le...'332 cmd = "{vmaf} motion {fmt} {ref} {dis} {w} {h} > {log}".format(333 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,334 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=MOTION_LOG335 )336 run_process(cmd, shell=True)337 score, scores = read_log(MOTION_LOG, "motion")338 self.assertAlmostEquals(score, 4.04982535417, places=4)339 def test_vif(self):340 VIF_LOG = self.LOG_FILENAME + '_vif'341 print 'test vif on yuv422p10le...'342 cmd = "{vmaf} vif {fmt} {ref} {dis} {w} {h} > {log}".format(343 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,344 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=VIF_LOG345 )346 run_process(cmd, shell=True)347 score, scores = read_log(VIF_LOG, "vif")348 self.assertAlmostEquals(score, 0.4460930625, places=4)349 self.assertAlmostEquals(scores[0], 0.580304, places=4)350 self.assertAlmostEquals(scores[1], 0.492477, places=4)351 score, scores = read_log(VIF_LOG, "vif_num")352 self.assertAlmostEquals(score, 712650.023478, places=0)353 score, scores = read_log(VIF_LOG, "vif_den")354 self.assertAlmostEquals(score, 1597314.95249, places=0)355 score, scores = read_log(VIF_LOG, "vif_num_scale0")356 self.assertAlmostEquals(score, 468101.509766, places=0)357 score, scores = read_log(VIF_LOG, "vif_num_scale1")358 self.assertAlmostEquals(score, 184971.572266, places=1)359 score, scores = read_log(VIF_LOG, "vif_num_scale2")360 self.assertAlmostEquals(score, 47588.8323567, places=0)361 score, scores = read_log(VIF_LOG, "vif_num_scale3")362 self.assertAlmostEquals(score, 11988.1090902, places=1)363 score, scores = read_log(VIF_LOG, "vif_den_scale0")364 self.assertAlmostEquals(score, 1287822.80208, places=0)365 score, scores = read_log(VIF_LOG, "vif_den_scale1")366 self.assertAlmostEquals(score, 241255.067708, places=1)367 score, scores = read_log(VIF_LOG, "vif_den_scale2")368 self.assertAlmostEquals(score, 55149.8169759, places=2)369 score, scores = read_log(VIF_LOG, "vif_den_scale3")370 self.assertAlmostEquals(score, 13087.2657267, places=2)371 def test_all(self):372 ALL_LOG = self.LOG_FILENAME + "_all"373 print 'test all on yuv422p10le...'374 cmd = "{vmaf} all {fmt} {ref} {dis} {w} {h} > {log}".format(375 vmaf=ExternalProgram.vmaf, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,376 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=ALL_LOG377 )378 run_process(cmd, shell=True)379 score, scores = read_log(ALL_LOG, "vif")380 self.assertAlmostEquals(score, 0.4460930625, places=4)381 score, scores = read_log(ALL_LOG, "motion")382 self.assertAlmostEquals(score, 4.04982535417, places=4)383 score, scores = read_log(ALL_LOG, "ansnr")384 self.assertAlmostEquals(score, 23.5095715208, places=4)385 score, scores = read_log(ALL_LOG, "adm")386 self.assertAlmostEquals(score, 0.9345877708333336, places=4)387 score, scores = read_log(ALL_LOG, "adm_num")388 self.assertAlmostEquals(score, 371.8354140624999, places=4)389 score, scores = read_log(ALL_LOG, "adm_den")390 self.assertAlmostEquals(score, 397.8337897291667, places=4)391 score, scores = read_log(ALL_LOG, "vif_num")392 self.assertAlmostEquals(score, 712650.023478, places=0)393 score, scores = read_log(ALL_LOG, "vif_den")394 self.assertAlmostEquals(score, 1597314.95249, places=0)395 score, scores = read_log(ALL_LOG, "anpsnr")396 self.assertAlmostEquals(score, 34.1902860625, places=4)397 score, scores = read_log(ALL_LOG, "vif_num_scale0")398 self.assertAlmostEquals(score, 468101.509766, places=0)399 score, scores = read_log(ALL_LOG, "vif_num_scale1")400 self.assertAlmostEquals(score, 184971.572266, places=1)401 score, scores = read_log(ALL_LOG, "vif_num_scale2")402 self.assertAlmostEquals(score, 47588.8323567, places=0)403 score, scores = read_log(ALL_LOG, "vif_num_scale3")404 self.assertAlmostEquals(score, 11988.1090902, places=1)405 score, scores = read_log(ALL_LOG, "vif_den_scale0")406 self.assertAlmostEquals(score, 1287822.80208, places=0)407 score, scores = read_log(ALL_LOG, "vif_den_scale1")408 self.assertAlmostEquals(score, 241255.067708, places=1)409 score, scores = read_log(ALL_LOG, "vif_den_scale2")410 self.assertAlmostEquals(score, 55149.8169759, places=2)411 score, scores = read_log(ALL_LOG, "vif_den_scale3")412 self.assertAlmostEquals(score, 13087.2657267, places=2)413 score, scores = read_log(ALL_LOG, "adm_den_scale0")414 self.assertAlmostEquals(score, 50.143851375000004, places=4)415 score, scores = read_log(ALL_LOG, "adm_num_scale1")416 self.assertAlmostEquals(score, 66.58064533333334, places=4)417 score, scores = read_log(ALL_LOG, "adm_den_scale1")418 self.assertAlmostEquals(score, 74.47438285416666, places=4)419 score, scores = read_log(ALL_LOG, "adm_num_scale2")420 self.assertAlmostEquals(score, 105.56477879166668, places=4)421 score, scores = read_log(ALL_LOG, "adm_den_scale2")422 self.assertAlmostEquals(score, 113.49725852083333, places=4)423 score, scores = read_log(ALL_LOG, "adm_num_scale3")424 self.assertAlmostEquals(score, 154.16224066666666, places=4)425 score, scores = read_log(ALL_LOG, "adm_den_scale3")426 self.assertAlmostEquals(score, 159.71829710416668, places=4)427 def test_psnr(self):428 PSNR_LOG = self.LOG_FILENAME + '_psnr'429 print 'test psnr on yuv422p10le...'430 cmd = "{psnr} {fmt} {ref} {dis} {w} {h} > {log}".format(431 psnr=ExternalProgram.psnr, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,432 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=PSNR_LOG433 )434 run_process(cmd, shell=True)435 score, scores = read_log(PSNR_LOG, "psnr")436 self.assertAlmostEquals(score, 30.7805732917, places=4)437 self.assertAlmostEquals(scores[0], 34.786288, places=4)438 self.assertAlmostEquals(scores[1], 31.908737, places=4)439 def test_ssim(self):440 SSIM_LOG = self.LOG_FILENAME + '_ssim'441 print 'test ssim on yuv422p10le...'442 cmd = "{ssim} {fmt} {ref} {dis} {w} {h} > {log}".format(443 ssim=ExternalProgram.ssim, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,444 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=SSIM_LOG445 )446 run_process(cmd, shell=True)447 score, scores = read_log(SSIM_LOG, "ssim")448 self.assertAlmostEquals(score, 0.863226541666667, places=4)449 self.assertAlmostEquals(scores[0], 0.925023, places=4)450 self.assertAlmostEquals(scores[1], 0.891992, places=4)451 score, scores = read_log(SSIM_LOG, "ssim_l")452 self.assertAlmostEquals(score,0.998147458333333, places=4)453 self.assertAlmostEquals(scores[0], 0.999524, places=4)454 self.assertAlmostEquals(scores[1], 0.998983, places=4)455 score, scores = read_log(SSIM_LOG, "ssim_c")456 self.assertAlmostEquals(score, 0.9612679375000001, places=4)457 self.assertAlmostEquals(scores[0], 0.979614, places=4)458 self.assertAlmostEquals(scores[1], 0.96981, places=4)459 score, scores = read_log(SSIM_LOG, "ssim_s")460 self.assertAlmostEquals(score, 0.8977363333333335, places=4)461 self.assertAlmostEquals(scores[0], 0.943966, places=4)462 self.assertAlmostEquals(scores[1], 0.919507, places=4)463 def test_ms_ssim(self):464 MS_SSIM_LOG = self.LOG_FILENAME + '_msssim'465 print 'test ms_ssim on yuv422p10le...'466 cmd = "{ms_ssim} {fmt} {ref} {dis} {w} {h} > {log}".format(467 ms_ssim=ExternalProgram.ms_ssim, fmt=self.YUV_FMT, ref=self.REF_YUV, dis=self.DIS_YUV,468 w=self.YUV_WIDTH, h=self.YUV_HEIGHT, log=MS_SSIM_LOG469 )470 run_process(cmd, shell=True)471 score, scores = read_log(MS_SSIM_LOG, "ms_ssim")472 self.assertAlmostEquals(score, 0.9632498125, places=4)473 self.assertAlmostEquals(scores[0], 0.981968, places=4)474 self.assertAlmostEquals(scores[1], 0.973366, places=4)475 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale0")476 self.assertAlmostEquals(score, 0.998147458333333, places=4)477 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale0")478 self.assertAlmostEquals(score, 0.9612679375000001, places=4)479 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale0")480 self.assertAlmostEquals(score, 0.8977363333333335, places=4)481 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale1")482 self.assertAlmostEquals(score, 0.9989961250000002, places=4)483 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale1")484 self.assertAlmostEquals(score, 0.9857694375, places=4)485 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale1")486 self.assertAlmostEquals(score, 0.941185875, places=4)487 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale2")488 self.assertAlmostEquals(score, 0.9992356458333332, places=4)489 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale2")490 self.assertAlmostEquals(score, 0.997034020833, places=4)491 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale2")492 self.assertAlmostEquals(score, 0.977992145833, places=4)493 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale3")494 self.assertAlmostEquals(score, 0.9992921041666665, places=4)495 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale3")496 self.assertAlmostEquals(score, 0.9995884375000003, places=4)497 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale3")498 self.assertAlmostEquals(score, 0.9938712499999998, places=4)499 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_l_scale4")500 self.assertAlmostEquals(score, 0.9994035625000003, places=4)501 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_c_scale4")502 self.assertAlmostEquals(score, 0.999907625, places=4)503 score, scores = read_log(MS_SSIM_LOG, "ms_ssim_s_scale4")504 self.assertAlmostEquals(score,0.998222583333, places=4)505class CornerCaseTest(unittest.TestCase):506 LOG_FILENAME = VmafConfig.workdir_path("logCornerCaseTest")507 CMD_TEMPLATE = """508 {vmaf} vif {fmt} {ref} {dis} {w} {h} > {log};509 {vmaf} adm {fmt} {ref} {dis} {w} {h} >> {log};510 {vmaf} ansnr {fmt} {ref} {dis} {w} {h} >> {log};511 {vmaf} motion {fmt} {ref} {dis} {w} {h} >> {log};"""512 def setUp(self):513 unittest.TestCase.setUp(self)514 if os.path.exists(self.LOG_FILENAME):515 os.remove(self.LOG_FILENAME)516 def tearDown(self):517 unittest.TestCase.tearDown(self)518 if os.path.exists(self.LOG_FILENAME):519 os.remove(self.LOG_FILENAME)520 if (REMOVE_LOG):521 (logPath, logFilePrefix) = os.path.split(self.LOG_FILENAME)522 filenames = [filename for filename in os.listdir(logPath) if filename.startswith(logFilePrefix)]523 for filename in filenames:524 os.remove(os.path.join(logPath, filename))525 def test_checkerboard_identical(self):526 print 'test on checkerboard pattern identical...'527 LOCAL_LOG_FILENAME = self.LOG_FILENAME + '_checkerboardIdentical'528 ref_yuv = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_0_0.yuv")529 dis_yuv = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_0_0.yuv")530 yuv_fmt = "yuv420p"531 yuv_width = 1920532 yuv_height = 1080533 cmd = self.CMD_TEMPLATE.format(vmaf=ExternalProgram.vmaf, fmt=yuv_fmt, ref=ref_yuv,534 dis=dis_yuv, w=yuv_width, h=yuv_height,535 log=LOCAL_LOG_FILENAME)536 run_process(cmd, shell=True)537 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm")[0], 1.0, places=4)538 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "ansnr")[0], 21.1138813333, places=4)539 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "motion")[0], 12.554836666666667, places=4)540 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif")[0], 1.0, places=4)541 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num")[0], 2773.891225, places=3)542 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den")[0], 2773.891225, places=3)543 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num")[0], 33021350.5, places=-3)544 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den")[0], 33021387.0625, places=3)545 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "anpsnr")[0], 29.8567246667, places=3)546 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale0")[0], 25757432.0, places=-3)547 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale0")[0], 25757473.3333, places=3)548 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale3")[0], 259774.958333, places=1)549 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale3")[0], 259774.9375, places=3)550 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale0")[0], 277.120382, places=3)551 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale0")[0], 277.120382, places=3)552 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale3")[0], 924.193766, places=3)553 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale3")[0], 924.193766, places=3)554 def test_checkerboard_shifted_by_1(self):555 print 'test on checkerboard pattern shifted by 1...'556 LOCAL_LOG_FILENAME = self.LOG_FILENAME + '_checkerboard_shifted_by_1'557 ref_yuv = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_0_0.yuv")558 dis_yuv = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_1_0.yuv")559 yuv_fmt = "yuv420p"560 yuv_width = 1920561 yuv_height = 1080562 cmd = self.CMD_TEMPLATE.format(vmaf=ExternalProgram.vmaf, fmt=yuv_fmt, ref=ref_yuv,563 dis=dis_yuv, w=yuv_width, h=yuv_height,564 log=LOCAL_LOG_FILENAME)565 run_process(cmd, shell=True)566 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm")[0], 0.7853383333333334, places=4)567 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "ansnr")[0], 7.92623066667, places=4)568 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "motion")[0], 12.5548366667, places=4)569 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif")[0], 0.156834666667, places=4)570 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num")[0], 2178.5352886666665, places=3)571 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den")[0], 2773.891225, places=3)572 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num")[0], 5178894.51562, places=-1)573 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den")[0], 33021387.0625, places=3)574 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "anpsnr")[0], 16.669074, places=4)575 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale0")[0], 2908829.0, places=-1)576 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale0")[0], 25757473.3333, places=3)577 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale3")[0], 128957.796875, places=-2)578 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale3")[0], 259774.9375, places=3)579 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale0")[0], 201.15329999999997, places=3)580 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale0")[0], 277.120382, places=3)581 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale3")[0], 765.1562903333333, places=3)582 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale3")[0], 924.193766, places=3)583 def test_checkerboard_opposite(self):584 print 'test on checkerboard pattern opposite...'585 LOCAL_LOG_FILENAME = self.LOG_FILENAME + '_checkerboard_opposite'586 ref_yuv = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_0_0.yuv")587 dis_yuv = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_10_0.yuv")588 yuv_fmt = "yuv420p"589 yuv_width = 1920590 yuv_height = 1080591 cmd = self.CMD_TEMPLATE.format(vmaf=ExternalProgram.vmaf, fmt=yuv_fmt, ref=ref_yuv,592 dis=dis_yuv, w=yuv_width, h=yuv_height,593 log=LOCAL_LOG_FILENAME)594 run_process(cmd, shell=True)595 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm")[0], 0.053996333333333334, places=4)596 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "ansnr")[0], -5.758091333333334, places=4)597 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "motion")[0], 12.554836666666667, places=4)598 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif")[0], 0.0, places=4)599 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num")[0], 149.780313, places=4)600 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den")[0], 2773.891225, places=3)601 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num")[0], 6.66666666667, places=4)602 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den")[0], 33021387.0625, places=3)603 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "anpsnr")[0], 2.984752, places=4)604 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale0")[0], 6.66666666667, places=4)605 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale0")[0], 25757473.3333, places=3)606 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale3")[0], 0.0, places=4)607 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale3")[0], 259774.9375, places=3)608 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale0")[0], 65.573967, places=3)609 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale0")[0], 277.120382, places=3)610 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale3")[0], 16.667711, places=3)611 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale3")[0], 924.193766, places=3)612 def test_flat_identical(self):613 print 'test on flat pattern identical...'614 LOCAL_LOG_FILENAME = self.LOG_FILENAME + '_flat_identical'615 ref_yuv = VmafConfig.test_resource_path("yuv", "flat_1920_1080_0.yuv")616 dis_yuv = VmafConfig.test_resource_path("yuv", "flat_1920_1080_0.yuv")617 yuv_fmt = "yuv420p"618 yuv_width = 1920619 yuv_height = 1080620 cmd = self.CMD_TEMPLATE.format(vmaf=ExternalProgram.vmaf, fmt=yuv_fmt, ref=ref_yuv,621 dis=dis_yuv, w=yuv_width, h=yuv_height,622 log=LOCAL_LOG_FILENAME)623 run_process(cmd, shell=True)624 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm")[0], 1.0, places=4)625 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "ansnr")[0], 60.0, places=4)626 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "motion")[0], 0.0, places=4)627 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif")[0], 1.0, places=4)628 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num")[0], 149.780392, places=4)629 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den")[0], 149.780392, places=4)630 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num")[0], 2754000.15625, places=1)631 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den")[0], 2754000.0, places=4)632 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "anpsnr")[0], 60.0, places=4)633 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale0")[0], 2073600.125, places=4)634 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale0")[0], 2073600.000, places=4)635 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale3")[0], 32400.0, places=4)636 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale3")[0], 32400.0, places=4)637 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale0")[0], 65.573967, places=3)638 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale0")[0], 65.573967, places=3)639 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale3")[0], 16.667747, places=3)640 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale3")[0], 16.667747, places=3)641 def test_flat_value10(self):642 print 'test on flat pattern of value 10...'643 LOCAL_LOG_FILENAME = self.LOG_FILENAME + '_flat_value10'644 ref_yuv = VmafConfig.test_resource_path("yuv", "flat_1920_1080_0.yuv")645 dis_yuv = VmafConfig.test_resource_path("yuv", "flat_1920_1080_10.yuv")646 yuv_fmt = "yuv420p"647 yuv_width = 1920648 yuv_height = 1080649 cmd = self.CMD_TEMPLATE.format(vmaf=ExternalProgram.vmaf, fmt=yuv_fmt, ref=ref_yuv,650 dis=dis_yuv, w=yuv_width, h=yuv_height,651 log=LOCAL_LOG_FILENAME)652 run_process(cmd, shell=True)653 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm")[0], 1.0, places=4)654 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "ansnr")[0], 21.899511, places=4)655 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "motion")[0], 0.0, places=4)656 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif")[0], 1.0, places=4)657 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num")[0], 149.780313, places=4)658 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den")[0], 149.780392, places=4)659 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num")[0], 2753999.99219, places=1)660 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den")[0], 2754000.0, places=4)661 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "anpsnr")[0], 29.045954, places=4)662 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale0")[0],2073600.0, places=4)663 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale0")[0], 2073600.0, places=4)664 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_num_scale3")[0], 32400.0, places=4)665 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "vif_den_scale3")[0], 32400.0, places=4)666 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale0")[0], 65.573967, places=3)667 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale0")[0], 65.573967, places=3)668 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_num_scale3")[0], 16.667711, places=3)669 self.assertAlmostEquals(read_log(LOCAL_LOG_FILENAME, "adm_den_scale3")[0], 16.667747, places=3)670if __name__ == '__main__':671 unittest.main()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run robotframework-pageobjects automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful