Skip to content

Commit

Permalink
more tests on ugly classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jandom committed Aug 20, 2023
1 parent fac255e commit 2a97578
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,194 @@
]),
])
# ---
# name: test_TopologyParsers
# name: test_TopologyParsers_attrs
defaultdict({
'altLocs': set({
':ref:`MMTF <MMTF-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'angles': set({
':ref:`DATA <DATA-format>`',
':ref:`GSD <GSD-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`XML <XML-format>`',
}),
'atomiccharges': set({
':ref:`GMS <GMS-format>`',
}),
'atomnums': set({
':ref:`DMS <DMS-format>`',
}),
'bonds': set({
':ref:`DATA <DATA-format>`',
':ref:`DMS <DMS-format>`',
':ref:`GSD <GSD-format>`',
':ref:`MMTF <MMTF-format>`',
':ref:`MOL2 <MOL2-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`TXYZ, ARC <TXYZ-format>`',
':ref:`XML <XML-format>`',
}),
'chainIDs': set({
':ref:`DMS <DMS-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'charges': set({
':ref:`DATA <DATA-format>`',
':ref:`DMS <DMS-format>`',
':ref:`GSD <GSD-format>`',
':ref:`MMTF <MMTF-format>`',
':ref:`MOL2 <MOL2-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`PQR <PQR-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`XML <XML-format>`',
}),
'dihedrals': set({
':ref:`DATA <DATA-format>`',
':ref:`GSD <GSD-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`XML <XML-format>`',
}),
'elements': set({
':ref:`IN, FHIAIMS <IN-format>`',
':ref:`MOL2 <MOL2-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`TPR <TPR-format>`',
':ref:`TXYZ, ARC <TXYZ-format>`',
':ref:`XYZ <XYZ-format>`',
}),
'icodes': set({
':ref:`MMTF <MMTF-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`PQR <PQR-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'impropers': set({
':ref:`DATA <DATA-format>`',
':ref:`GSD <GSD-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`XML <XML-format>`',
}),
'masses': set({
':ref:`CONFIG <CONFIG-format>`',
':ref:`CRD <CRD-format>`',
':ref:`GMS <GMS-format>`',
':ref:`GRO <GRO-format>`',
':ref:`HISTORY <HISTORY-format>`',
':ref:`IN, FHIAIMS <IN-format>`',
':ref:`LAMMPSDUMP <LAMMPSDUMP-format>`',
':ref:`MMTF <MMTF-format>`',
':ref:`MOL2 <MOL2-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`PQR <PQR-format>`',
':ref:`TXYZ, ARC <TXYZ-format>`',
':ref:`XPDB <XPDB-format>`',
':ref:`XYZ <XYZ-format>`',
}),
'models': set({
':ref:`MMTF <MMTF-format>`',
}),
'molnums': set({
':ref:`TPR <TPR-format>`',
}),
'moltypes': set({
':ref:`TPR <TPR-format>`',
}),
'names': set({
':ref:`CONFIG <CONFIG-format>`',
':ref:`CRD <CRD-format>`',
':ref:`DMS <DMS-format>`',
':ref:`GMS <GMS-format>`',
':ref:`GRO <GRO-format>`',
':ref:`GSD <GSD-format>`',
':ref:`HISTORY <HISTORY-format>`',
':ref:`IN, FHIAIMS <IN-format>`',
':ref:`MMTF <MMTF-format>`',
':ref:`MOL2 <MOL2-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`PQR <PQR-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`TXYZ, ARC <TXYZ-format>`',
':ref:`XPDB <XPDB-format>`',
':ref:`XYZ <XYZ-format>`',
}),
'occupancies': set({
':ref:`MMTF <MMTF-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'radii': set({
':ref:`GSD <GSD-format>`',
':ref:`PQR <PQR-format>`',
':ref:`XML <XML-format>`',
}),
'record_types': set({
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`PQR <PQR-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'resnames': set({
':ref:`CRD <CRD-format>`',
':ref:`DMS <DMS-format>`',
':ref:`GRO <GRO-format>`',
':ref:`GSD <GSD-format>`',
':ref:`MMTF <MMTF-format>`',
':ref:`MOL2 <MOL2-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`PQR <PQR-format>`',
':ref:`PSF <PSF-format>`',
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
':ref:`TPR <TPR-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'tempfactors': set({
':ref:`CRD <CRD-format>`',
':ref:`MMTF <MMTF-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PDBQT <PDBQT-format>`',
':ref:`XPDB <XPDB-format>`',
}),
'type_indices': set({
':ref:`TOP, PRMTOP, PARM7 <TOP-format>`',
}),
'types': set({
':ref:`CONFIG <CONFIG-format>`',
':ref:`CRD <CRD-format>`',
':ref:`DMS <DMS-format>`',
':ref:`GMS <GMS-format>`',
':ref:`GRO <GRO-format>`',
':ref:`HISTORY <HISTORY-format>`',
':ref:`IN, FHIAIMS <IN-format>`',
':ref:`PDB, ENT <PDB-format>`',
':ref:`PQR <PQR-format>`',
':ref:`XPDB <XPDB-format>`',
':ref:`XYZ <XYZ-format>`',
}),
})
# ---
# name: test_TopologyParsers_lines
list([
list([
':ref:`CONFIG <CONFIG-format>`',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
from MDAnalysis.core import selection as sel


def test_TopologyParsers(snapshot):
def test_TopologyParsers_lines(snapshot):
with patch("builtins.open"):
top = TopologyParsers()
assert top.lines == snapshot


def test_TopologyParsers_attrs(snapshot):
with patch("builtins.open"):
top = TopologyParsers()
assert top.attrs == snapshot


def test_TopologyAttrs(snapshot):
with patch("builtins.open"):
top = TopologyParsers()
Expand Down

0 comments on commit 2a97578

Please sign in to comment.