Best Python code snippet using Airtest
fakexinerama_test.py
Source:fakexinerama_test.py
...12 def test_config(self):13 from xpra.x11.fakeXinerama import save_fakeXinerama_config, cleanup_fakeXinerama, log14 #silence warnings during tests:15 log.warn = log.debug16 def get_display_info(*monitors):17 #display_name, width, height, width_mm, height_mm, \18 #monitors, work_x, work_y, work_width, work_height = s[:11]19 return (20 "fake-display",21 1920, 1080, 400, 300,22 monitors, 0, 60, 1920, 1020,23 )24 monitor0 = ("plug0", 0, 0, 1920, 1080, 400, 300)25 monitor1 = ("plug1", 1920, 0, 1920, 1080, 300, 200)26 for ss in (27 get_display_info(),28 get_display_info((0, 0)),29 get_display_info(monitor0),30 get_display_info(monitor0, monitor1),31 (800, 600),32 (1, 2, 3, 4, 5),33 ):34 save_fakeXinerama_config(True, "", (ss, ))35 cleanup_fakeXinerama()36def main():37 #can only work with an X11 server38 if POSIX and not OSX:39 unittest.main()40if __name__ == '__main__':...
fs.py
Source:fs.py
...7# http://www.gnu.org/licenses/gpl-3.0.html8from hscommon.util import format_size9from core import fs10from core.util import format_timestamp, format_perc, format_words, format_dupe_count11def get_display_info(dupe, group, delta):12 size = dupe.size13 mtime = dupe.mtime14 m = group.get_match_of(dupe)15 if m:16 percentage = m.percentage17 dupe_count = 018 if delta:19 r = group.ref20 size -= r.size21 mtime -= r.mtime22 else:23 percentage = group.percentage24 dupe_count = len(group.dupes)25 return {26 "name": dupe.name,27 "folder_path": str(dupe.folder_path),28 "size": format_size(size, 0, 1, False),29 "extension": dupe.extension,30 "mtime": format_timestamp(mtime, delta and m),31 "percentage": format_perc(percentage),32 "words": format_words(dupe.words) if hasattr(dupe, "words") else "",33 "dupe_count": format_dupe_count(dupe_count),34 }35class File(fs.File):36 def get_display_info(self, group, delta):37 return get_display_info(self, group, delta)38class Folder(fs.Folder):39 def get_display_info(self, group, delta):...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!