Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
pdbe
ccdutils
Commits
c3c18bd0
Commit
c3c18bd0
authored
Oct 28, 2020
by
Lukas Pravda
Browse files
add more tests
parent
0673003f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
pdbeccdutils/tests/conftest.py
pdbeccdutils/tests/conftest.py
+6
-0
pdbeccdutils/tests/test_fragment_library.py
pdbeccdutils/tests/test_fragment_library.py
+30
-0
pdbeccdutils/tests/test_scaffold_generation.py
pdbeccdutils/tests/test_scaffold_generation.py
+11
-0
No files found.
pdbeccdutils/tests/conftest.py
View file @
c3c18bd0
...
...
@@ -2,6 +2,7 @@
"""
import
pytest
from
pdbeccdutils.core
import
ccd_reader
from
pdbeccdutils.core.fragment_library
import
FragmentLibrary
from
pdbeccdutils.tests.tst_utilities
import
supply_list_of_sample_cifs
sample_ccd_cifs
=
supply_list_of_sample_cifs
()
...
...
@@ -17,3 +18,8 @@ def component(request):
assert
reader
.
warnings
==
[]
return
c
@
pytest
.
fixture
(
scope
=
"session"
)
def
library
():
return
FragmentLibrary
()
pdbeccdutils/tests/test_fragment_library.py
0 → 100644
View file @
c3c18bd0
"""Test fragment library functionality
"""
import
os
import
xml.etree.ElementTree
as
ET
from
pdbeccdutils.core.fragment_library
import
FragmentLibrary
from
pdbeccdutils.helpers.drawing
import
svg_namespace
def
test__img_crated
(
library
,
tmpdir
):
file_path
=
str
(
tmpdir
.
join
(
'library.svg'
))
library
.
to_image
(
file_path
)
assert
os
.
path
.
isfile
(
file_path
)
xml
=
ET
.
parse
(
file_path
)
assert
len
(
xml
.
findall
(
'svg:rect'
,
svg_namespace
))
>
100
def
test_img_png_created
(
library
,
tmpdir
):
file_path
=
str
(
tmpdir
.
join
(
'library.png'
))
library
.
to_image
(
file_path
,
source
=
"PDBe"
)
assert
os
.
path
.
isfile
(
file_path
)
def
test_generate_conformers
(
library
):
library
.
generate_conformers
()
for
entry
in
library
.
library
.
values
():
assert
entry
.
mol
.
GetConformers
()
\ No newline at end of file
pdbeccdutils/tests/test_scaffold_generation.py
View file @
c3c18bd0
...
...
@@ -2,6 +2,7 @@ import pytest
from
rdkit
import
Chem
from
pdbeccdutils.core
import
ccd_reader
from
pdbeccdutils.core.models
import
ScaffoldingMethod
from
pdbeccdutils.tests.tst_utilities
import
cif_filename
test_inputs
=
[
...
...
@@ -41,3 +42,13 @@ class TestScaffold:
assert
result
[
0
].
GetNumAtoms
()
==
0
assert
not
component
.
scaffolds
@
staticmethod
@
pytest
.
mark
.
parametrize
(
"scaffold_type"
,
[
ScaffoldingMethod
.
MurckoGeneric
,
ScaffoldingMethod
.
Brics
]
)
def
test_scaffolds
(
scaffold_type
):
c
=
ccd_reader
.
read_pdb_cif_file
(
cif_filename
(
"NAG"
)).
component
c
.
get_scaffolds
(
scaffold_type
)
assert
len
(
c
.
scaffolds
)
>
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment