Beispiel #1
0
def test_show_schrodinger():
    # Show a schrodinger.structure.Structure
    s = MagicMock()
    s.write = _write
    v0 = nglview.show_schrodinger(s)

    # Show a trajectory with a Structure as topology
    class MockAtom:
        pdbname = 'C'
        atomic_number = 6
        pdbres = 'GLU'
        resnum = 1
        chain = 'A'

    s = MagicMock()
    s.fsys_ct.getXYZ.return_value = np.zeros((3, 3))
    s.fsys_ct.atom = [MockAtom()] * 3
    traj = MagicMock()
    traj.__len__.return_value = 3
    v1 = nglview.show_schrodinger(s, traj)
    assert v1.max_frame == 2
    v1.frame = 2  # trigger `get_coordinates`
Beispiel #2
0
def test_show_schrodinger():
    s = MagicMock()
    s.write = _write
    nglview.show_schrodinger(s)