File: test_editing.py

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (20 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pymol import cmd
from pymol import test_utils
import pytest


@test_utils.requires_version("3.0")
def test_look_at():
    ori_view = cmd.get_view()
    cmd.pseudoatom("M1", pos=[10, 0, 0])
    cmd.look_at("M1")
    new_view = cmd.get_view()
    assert ori_view != new_view

    ref_new_view = (0.980580688,    0.000000000,   -0.196116135,
                    0.000000000,    1.000000000,    0.000000000,
                    0.196116135,    0.000000000,    0.980580688,
                    -9.805807114,    0.000000000,  -49.029033661,
                    0.000000000,    0.000000000,    0.000000000,
                    40.000000000,  100.000000000,  -20.000000000)
    assert ref_new_view == pytest.approx(new_view)