def setUp(self): self.current_directory = os.path.dirname(os.path.abspath(__file__)) mock = WebdriverMock( command_executor_url="http://{host}:{port}/wd/hub".format( host=Config.server, port=Config.port), desired_capabilities=DesiredCapabilities.CHROME) self.dali = Dali(mock)
def test_example(self): def callback(driver): """ :type driver: Remote """ driver.implicitly_wait(5) driver.get("http://go.2gis.com/uvaw") driver.find_element_by_css_selector(".dg-traf-scores-wr").click() dali = Dali(self.driver) options1 = Options( substitute={".dg-routs>.dg-btn-label": "Lorem Ipsum"}, hide_elements=[".dg-start-banner"], disable_animation=True) options2 = Options(hide_elements=[".dg-start-banner"], disable_animation=True) file1 = dali.take_screenshot( resolution="1024x768", scenario=callback, scenario_args=self.driver, options=options1, path_to_save="./", ) file2 = dali.take_screenshot( resolution="1024x768", scenario=callback, scenario_args=self.driver, options=options2, path_to_save="./", ) diff = dali.compare_images(file1, file2, "./out.png") self.assertEquals(diff, 0.0, "The difference is %f" % diff)
#!/usr/bin/env python3.7 from dali import Dali from pdb import Pdb from os import path import sys tmpDir = '.' daliFile = '1tenA.txt' myRefPdb = '1ten' myRefChain = 'A' myZ = 2. myTmpPath = './pdb' + myRefPdb + myRefChain v = True dali = Dali(refPdb=myRefPdb, refChain=myRefChain, tmpPath=myTmpPath, verbose=v) #dali.CallDali( dali.ReadFile(daliFile, verbose=v) dali.RemoveDissimilar(z=myZ) dali.GetSequenceFromPdb(tmpPath=myTmpPath, localPdb='', verbose=v, paranoid=False) dali.RemoveInternalHomologs(byOrganism=True, dropNoOrganism=True, orderBy='lali') dali.AlignToRef() dali.PrintAlignment() dali.CalculateEntropy(toPrint=True, filename='entropy_' + myRefPdb + myRefChain + '.dat')