Skip to content

Commit

Permalink
fix problem in scheduler plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
jimboid committed Nov 11, 2016
1 parent 175176a commit 5e37787
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Longbow/schedulers/lsf.py
Expand Up @@ -241,7 +241,7 @@ def submit(job):
raise exceptions.JobsubmitError(
"Something went wrong when submitting. The following output "
"came back from the SSH call:\nstdout: {0}\nstderr {1}"
.format(shellout[0], shellout[1]))
.format(inst.stdout, inst.stderr))

try:

Expand Down
2 changes: 1 addition & 1 deletion Longbow/schedulers/pbs.py
Expand Up @@ -337,7 +337,7 @@ def submit(job):
raise exceptions.JobsubmitError(
"Something went wrong when submitting. The following output "
"came back from the SSH call:\nstdout: {0}\nstderr {1}"
.format(shellout[0], shellout[1]))
.format(inst.stdout, inst.stderr))

try:

Expand Down
2 changes: 1 addition & 1 deletion Longbow/schedulers/sge.py
Expand Up @@ -232,7 +232,7 @@ def submit(job):
raise exceptions.JobsubmitError(
"Something went wrong when submitting. The following output "
"came back from the SSH call:\nstdout: {0}\nstderr {1}"
.format(shellout[0], shellout[1]))
.format(inst.stdout, inst.stderr))

try:

Expand Down
2 changes: 1 addition & 1 deletion Longbow/schedulers/slurm.py
Expand Up @@ -248,7 +248,7 @@ def submit(job):
raise exceptions.JobsubmitError(
"Something went wrong when submitting. The following output "
"came back from the SSH call:\nstdout: {0}\nstderr {1}"
.format(shellout[0], shellout[1]))
.format(inst.stdout, inst.stderr))

try:

Expand Down
2 changes: 1 addition & 1 deletion Longbow/schedulers/soge.py
Expand Up @@ -250,7 +250,7 @@ def submit(job):
raise exceptions.JobsubmitError(
"Something went wrong when submitting. The following output "
"came back from the SSH call:\nstdout: {0}\nstderr {1}"
.format(shellout[0], shellout[1]))
.format(inst.stdout, inst.stderr))

try:

Expand Down
56 changes: 56 additions & 0 deletions Tests/unit/schedulers_pbs/test_submit1.py
@@ -0,0 +1,56 @@

# Longbow is Copyright (C) of James T Gebbie-Rayet and Gareth B Shannon 2015.
#
# This file is part of the Longbow software which was developed as part of the
# HECBioSim project (http://www.hecbiosim.ac.uk/).
#
# HECBioSim facilitates and supports high-end computing within the UK
# biomolecular simulation community on resources such as ARCHER.
#
# Longbow is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 2 of the License, or (at your option) any later
# version.
#
# Longbow is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Longbow. If not, see <http://www.gnu.org/licenses/>.

"""
This test module contains tests for the PBS scheduler plugin.
"""

try:

from unittest import mock

except ImportError:

import mock

import pytest

import Longbow.corelibs.exceptions as exceptions
import Longbow.schedulers.pbs as pbs


@mock.patch('Longbow.corelibs.shellwrappers.sendtossh')
def test_submit_except1(mock_ssh):

"""
"""

job = {
"destdir": "/path/to/destdir",
"subfile": "submit.file"
}

mock_ssh.side_effect = exceptions.SSHError("Error", ("out", "err", 0))
mock_ssh.return_value = ("success", "error", 0)

with pytest.raises(exceptions.JobsubmitError):

pbs.submit(job)
Empty file.
3 changes: 0 additions & 3 deletions Tests/unit/test_longbow.py

This file was deleted.

Empty file removed Tests/unit/test_plugins_apps.py
Empty file.
Empty file.

0 comments on commit 5e37787

Please sign in to comment.