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
6424dafe
Commit
6424dafe
authored
14 years ago
by
Tobias Schmidt
Committed by
Marco Biasini
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added version check for msms unit test, fixes BZDNG-176
parent
09d0cb66
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/bindings/pymod/msms.py
+16
-1
16 additions, 1 deletion
modules/bindings/pymod/msms.py
modules/bindings/tests/test_msms.py
+4
-0
4 additions, 0 deletions
modules/bindings/tests/test_msms.py
with
20 additions
and
1 deletion
modules/bindings/pymod/msms.py
+
16
−
1
View file @
6424dafe
...
...
@@ -38,6 +38,21 @@ class MsmsProcessError(Exception):
return
repr
(
self
.
returncode
)
def
GetVersion
(
msms_exe
=
None
,
msms_env
=
None
):
msms_executable
=
_GetExecutable
(
msms_exe
,
msms_env
)
command
=
"
%s
"
%
(
msms_executable
)
proc
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
stdout_value
,
stderr_value
=
proc
.
communicate
()
version
=
""
for
l
in
stdout_value
.
splitlines
():
if
l
[
0
:
4
]
==
'
MSMS
'
:
version
=
l
.
split
(
'
'
)[
1
]
return
version
if
version
==
""
:
LogWarning
(
'
Could not parse MSMS version string
'
)
return
## \brief Method to check if MSMS executable is present
#
# \param msms_exe Explicit path to msms executable
...
...
@@ -120,7 +135,7 @@ def _RunMSMS(command):
#check for successful completion of msms
if
proc
.
returncode
!=
0
:
print
"
WARNING: msms error
\n
"
,
stdout_value
raise
subprocess
.
MsmsProcessError
(
proc
.
returncode
,
command
)
raise
MsmsProcessError
(
proc
.
returncode
,
command
)
return
stdout_value
...
...
This diff is collapsed.
Click to expand it.
modules/bindings/tests/test_msms.py
+
4
−
0
View file @
6424dafe
...
...
@@ -33,11 +33,15 @@ class TestMSMSBindings(unittest.TestCase):
if
__name__
==
"
__main__
"
:
# test if msms package is available on system, otherwise ignore tests
VERSION_REQUIRED
=
'
2.6.1
'
try
:
msms
.
_GetExecutable
(
msms_exe
=
None
,
msms_env
=
'
MSMSSERVER
'
)
except
(
settings
.
FileNotFound
):
print
"
Could not find msms executable: ignoring unit tests
"
exit
(
0
)
version
=
msms
.
GetVersion
(
msms_exe
=
None
,
msms_env
=
'
MSMSSERVER
'
)
if
version
!=
VERSION_REQUIRED
:
print
"
MSMS version (%s) does not match required version %s: ignoring unit tests
"
%
(
version
,
VERSION_REQUIRED
)
try
:
unittest
.
main
()
except
Exception
,
e
:
...
...
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