Ejemplo n.º 1
0
def test_unkown_fromat_error():
    with pytest.raises(IOError):
        ff = vermouth.forcefield.ForceField(name='test_ff')
        test_path = Path("random_file.extension")
        MetaMolecule.from_sequence_file(force_field=ff,
                                        file_path=test_path,
                                        mol_name="test")
Ejemplo n.º 2
0
    def test_from_seq_file(file_name, edges, nodes, attrs):
        ff = vermouth.forcefield.ForceField(name='test_ff')
        name = "test"
        meta_mol = MetaMolecule.from_sequence_file(ff, Path(file_name), name)

        assert len(nx.get_node_attributes(meta_mol, "resid")) == len(nodes)
        assert set(meta_mol.nodes) == set(nodes)
        assert set(meta_mol.edges) == set(edges)