Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
generate-run-shell: true
environment-name: ci
create-args: >-
pillow
pymol-open-source
pyopengl
pytest
requests

- name: Test
run: python3 -m pytest -v
shell: micromamba-shell {0}
9 changes: 9 additions & 0 deletions findseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,12 @@ def checkParams(needle, haystack, selName, het, matchMode):
print("Error: selName was not a string.")
return False
return True


def test_findseq():
cmd.reinitialize()
cmd.fab('ACDEFG', 'm1')
cmd.fab('HIKLMN', 'm2')
cmd.do('findseq DEF, *, foundSeq')
assert cmd.count_atoms("foundSeq and m1") == 47
assert cmd.count_atoms("foundSeq and m2") == 0
9 changes: 9 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[pytest]
addopts =
--ignore-glob=_*
--ignore-glob=gendocs.py
--import-mode=importlib
pythonpath = .
python_files = *.py
python_functions = test_*
norecursedirs = examples files_for_examples modules plugins