Best Python code snippet using molecule_python
test_config.py
Source:test_config.py  
...217    msg = "Failed to validate.\n\nvalidation errors"218    patched_logger_critical.assert_called_once_with(msg)219def test_molecule_directory():220    assert "/foo/bar/molecule" == config.molecule_directory("/foo/bar")221def test_molecule_file():222    assert "/foo/bar/molecule.yml" == config.molecule_file("/foo/bar")223def test_set_env_from_file(config_instance):224    config_instance.args = {"env_file": ".env"}225    contents = {"foo": "bar", "BAZ": "zzyzx"}226    env_file = config_instance.args.get("env_file")227    util.write_file(env_file, util.safe_dump(contents))228    env = config.set_env_from_file({}, env_file)229    assert contents == env230def test_set_env_from_file_returns_original_env_when_env_file_not_found(231    config_instance,232):233    env = config.set_env_from_file({}, "file-not-found")234    assert {} == env235def test_write_config(config_instance):...moleculefile.py
Source:moleculefile.py  
...4class TestBinaryInputFile(unittest.TestCase):5    datadir = os.getenv('HEDATADIR', os.getenv('HOME', 'c:/') + '/Helium/data')6    def test_data_dir(self):7        self.assertTrue(os.path.isdir(self.datadir))8    def test_molecule_file(self):9        f = helium.MoleculeFile()10        self.assertFalse(f.load('foo'))11        f.load(self.datadir + '/1K.hel')12        self.assertEqual(1000, f.numMolecules())13        mol = helium.Molecule()14        self.assertTrue(f.readMolecule(mol))15        self.assertEqual(8, mol.numAtoms())16        self.assertTrue(f.readMolecule(998, mol))17        self.assertEqual(29, mol.numAtoms())18        f.close()19        f = helium.MoleculeFile(self.datadir + '/1K.hel')20        self.assertTrue(f.readMolecule(0, mol))21        self.assertEqual(8, mol.numAtoms())22    def test_memory_mapped_molecule_file(self):...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!!
