Best Python code snippet using localstack_python
attractsave.py
Source:attractsave.py
...32 os.system("chmod +x %s" % sh)33 print("Shell script generated: %s" % sh)34 else:35 print("Cannot generate shell script: form does not contain a valid object")36def _deploy(resource, fname):37 if resource is not None:38 resource.link(fname)39 resource.save()40def deploy(model, dir):41 d = dir + "/"42 if dir in (None, "", ".", "./"): d = ""43 elif dir.endswith("/"): d = dir44 for n,p in enumerate(model.partners):45 _deploy(p.pdbfile,d+"partner-%d.pdb" % (n+1))46 _deploy(p.rmsd_pdb,d+"partner-rmsd-%d.pdb" % (n+1))47 _deploy(p.rmsd_pdb_alt,d+"partner-rmsd-alt-%d.pdb" % (n+1))48 _deploy(p.rmsd_pdb_alt2,d+"partner-rmsd-alt2-%d.pdb" % (n+1))49 _deploy(model.start_structures_file,d+"startstruc.dat")50 _deploy(model.rotations_file,d+"rotations.dat")51 _deploy(model.translations_file,d+"translations.dat")52 _deploy(model.harmonic_restraints_file,d+"harmonic-restraints.tbl")53 _deploy(model.haddock_restraints_file,d+"haddock-restraints.tbl")54 _deploy(model.position_restraints_file,d+"position-restraints.tbl")55def deploy_easy(model, dir):56 d = dir + "/"57 if dir in (None, "", ".", "./"): d = ""58 elif dir.endswith("/"): d = dir59 _deploy(model.partners[0].pdbfile,d+"receptor.pdb")60 _deploy(model.partners[0].rmsd_pdb,d+"receptor-rmsd.pdb")61 _deploy(model.partners[1].pdbfile,d+"ligand.pdb")62 _deploy(model.partners[1].rmsd_pdb,d+"ligand-rmsd.pdb")63 _deploy(model.harmonic_restraints_file,d+"harmonic-restraints.tbl")64 _deploy(model.position_restraints_file,d+"position-restraints.tbl")65def deploy_cryo(model, dir):66 d = dir + "/"67 if dir in (None, "", ".", "./"): d = ""68 elif dir.endswith("/"): d = dir69 for n,p in enumerate(model.partners):70 _deploy(p.pdbfile,d+"partner-%d.pdb" % (n+1))71 _deploy(model.mapfile,d+"map.sit")72 _deploy(model.harmonic_restraints_file,d+"harmonic-restraints.tbl")73def deploy_cryo_easy(model, dir):74 d = dir + "/"75 if dir in (None, "", ".", "./"): d = ""76 elif dir.endswith("/"): d = dir77 for n,p in enumerate(model.partners):78 _deploy(p.pdbfile,d+"partner-%d.pdb" % (n+1))79 _deploy(model.mapfile,d+"map.sit")80def deploy_peptide(model,dir):81 d = dir + "/"82 if dir in (None, "",".","./"): d = ""83 elif dir.endswith("/"): d = dir84 _deploy(model.p1.pdbfile,d+"receptor.pdb")85 _deploy(model.p1.rmsd_pdb,d+"receptor-rmsd.pdb")...
test_g5k_api.py
Source:test_g5k_api.py
...5from enoslib.tests.unit import EnosTest6class TestDeploy(EnosTest):7 def test_deploy_no_undeployed(self):8 with patch("enoslib.infra.enos_g5k.g5k_api_utils.deploy") as m:9 deployed, undeployed = _deploy("rennes", [], [], 0, {})10 m.assert_not_called()11 def test_deploy_max_count(self):12 deploy = mock.Mock()13 with patch("enoslib.infra.enos_g5k.g5k_api_utils.deploy") as m:14 deployed, undeployed = _deploy("rennes", [], [], 4, {})15 m.assert_not_called()16 def test_deploy_2_deploy(self):17 with patch(18 "enoslib.infra.enos_g5k.g5k_api_utils.deploy",19 side_effect=[([1], [2]), ([2], [])],20 ) as m:21 deployed, undeployed = _deploy("rennes", [], [1, 2], 0, {})22 self.assertCountEqual([1, 2], deployed)23 self.assertCountEqual([], undeployed)24 def test_deploy_3_deploy(self):25 with patch(26 "enoslib.infra.enos_g5k.g5k_api_utils.deploy",27 side_effect=[([1], [2]), ([], [2]), ([], [2])],28 ) as m:29 deployed, undeployed = _deploy("rennes", [], [1, 2], 0, {})30 self.assertCountEqual([1], deployed)...
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!!