Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
044db2f6
Commit
044db2f6
authored
9 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Proper testing of existance of compounds lib
parent
607a2778
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/conop/tests/test_compound.py
+25
-18
25 additions, 18 deletions
modules/conop/tests/test_compound.py
with
25 additions
and
18 deletions
modules/conop/tests/test_compound.py
+
25
−
18
View file @
044db2f6
import
unittest
import
unittest
import
os
from
ost
import
GetSharedDataPath
,
SetPrefixPath
from
ost
import
mol
from
ost
import
mol
from
ost
import
conop
from
ost
import
conop
def
setUpModule
():
SetPrefixPath
(
os
.
path
.
abspath
(
os
.
path
.
join
(
conop
.
__path__
[
0
],
os
.
pardir
,
os
.
pardir
,
os
.
pardir
,
os
.
pardir
,
os
.
pardir
)))
compound_lib_path
=
os
.
path
.
join
(
GetSharedDataPath
(),
'
compounds.chemlib
'
)
compound_lib
=
conop
.
CompoundLib
.
Load
(
compound_lib_path
)
conop
.
SetDefaultLib
(
compound_lib
)
class
TestCompound
(
unittest
.
TestCase
):
class
TestCompound
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
compound_lib
=
conop
.
GetDefaultLib
()
self
.
compound_lib
=
conop
.
GetDefaultLib
()
def
testFindCompound
(
self
):
def
testFindCompound
(
self
):
compound
=
self
.
compound_lib
.
FindCompound
(
'
***
'
)
compound
=
self
.
compound_lib
.
FindCompound
(
'
***
'
)
self
.
assertEqual
(
compound
,
None
)
self
.
assertEqual
(
compound
,
None
)
compound
=
self
.
compound_lib
.
FindCompound
(
'
ALA
'
)
compound
=
self
.
compound_lib
.
FindCompound
(
'
ALA
'
)
self
.
assertNotEqual
(
compound
,
None
)
self
.
assertNotEqual
(
compound
,
None
)
self
.
assertEqual
(
compound
.
id
,
'
ALA
'
)
self
.
assertEqual
(
compound
.
id
,
'
ALA
'
)
self
.
assertEqual
(
compound
.
three_letter_code
,
'
ALA
'
)
self
.
assertEqual
(
compound
.
three_letter_code
,
'
ALA
'
)
self
.
assertEqual
(
compound
.
one_letter_code
,
'
A
'
)
self
.
assertEqual
(
compound
.
one_letter_code
,
'
A
'
)
self
.
assertTrue
(
compound
.
IsPeptideLinking
())
self
.
assertTrue
(
compound
.
IsPeptideLinking
())
self
.
assertEqual
(
compound
.
dialect
,
'
PDB
'
)
self
.
assertEqual
(
compound
.
dialect
,
'
PDB
'
)
self
.
assertEqual
(
compound
.
formula
,
'
C3 H7 N O2
'
)
self
.
assertEqual
(
compound
.
formula
,
'
C3 H7 N O2
'
)
self
.
assertEqual
(
compound
.
chem_class
,
mol
.
L_PEPTIDE_LINKING
)
self
.
assertEqual
(
compound
.
chem_class
,
mol
.
L_PEPTIDE_LINKING
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
if
not
conop
.
GetDefaultLib
():
print
'
No compound library available. ignoring compound unit tests
'
else
:
from
ost
import
testutils
from
ost
import
testutils
testutils
.
RunTests
()
testutils
.
RunTests
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment