File: test_importing.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 (26 lines) | stat: -rw-r--r-- 816 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from pymol import cmd
from pymol import test_utils
from pymol.querying import cif_get_array


@test_utils.requires_version("3.0")
def test_bcif():
    cmd.load(test_utils.datafile("115d.bcif.gz"))
    assert cmd.count_atoms() == 407

@test_utils.requires_version("3.0")
def test_bcif_array():
    obj_name = "foo"
    cmd.set('cif_keepinmemory', 1)
    cmd.load(test_utils.datafile("115d.bcif.gz"), object=obj_name)
    arr = cif_get_array(obj_name, "_pdbx_database_status.entry_id", "s")
    assert arr == ["115D"]

    arr = cif_get_array(obj_name, "_entity_poly.pdbx_strand_id", "s")
    assert arr == ["A,B"]

    arr = cif_get_array(obj_name, "_pdbx_struct_oper_list.name", "s")
    assert arr == ["1_555"]

    arr = cif_get_array(obj_name, "_pdbx_struct_assembly.oligomeric_count", "i")
    assert arr == [2]