Skip to content

Commit 1837870

Browse files
committed
fixing up tests
1 parent cbefe82 commit 1837870

File tree

14 files changed

+38
-14
lines changed

14 files changed

+38
-14
lines changed

spython/instance/cmd/iutils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def get(self, name, return_json=False, quiet=False):
4747
'''get is a list for a single instance. It is assumed to be running,
4848
and we need to look up the PID, etc.
4949
'''
50-
self._check_install()
50+
from spython.utils import check_install
51+
check_install()
52+
5153
cmd = self._init_command('instance.list')
5254
cmd.append(name)
5355
output = run_command(cmd, quiet=True)

spython/instance/cmd/start.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def start(self, image=None, name=None, sudo=False, options=[]):
3434
singularity [...] instance.start [...] <container path> <instance name>
3535
3636
'''
37-
from spython.utils import run_command
38-
self._check_install()
37+
from spython.utils import ( run_command, check_install )
38+
check_install()
3939

4040
# If no name provided, give it an excellent one!
4141
if name is None:

spython/instance/cmd/stop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def stop(self, name=None, sudo=False):
3333
singularity [...] instance.start [...] <container path> <instance name>
3434
3535
'''
36-
from spython.utils import check_install, run_command
36+
from spython.utils import ( check_install, run_command )
3737
check_install()
3838

3939
cmd = self._init_command('instance.stop')

spython/main/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ def get_client(quiet=False, debug=False):
5656
# Command Groups, Images
5757
from spython.image.cmd import image_group # deprecated image commands
5858
Client.image = image_group
59-
Client.image._check_install = Client._check_install
6059

6160
# Commands Groups, Instances
6261
from spython.instance.cmd import instance_group # instance level commands
6362
Client.instance = instance_group
64-
Client.instance._check_install = Client._check_install
6563
Client.instance_stopall = stopall
6664

6765
# Initialize

spython/main/apps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def apps(self, image=None, full_path=False, root=''):
3232
image_path: full path to the image
3333
3434
'''
35-
self._check_install()
35+
from spython.utils import check_install
36+
check_install()
3637

3738
# No image provided, default to use the client's loaded image
3839
if image is None:
File renamed without changes.

spython/main/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def build(self, recipe=None,
5656
sudo: give sudo to the command (or not) default is True for build
5757
5858
'''
59-
self._check_install()
59+
from spython.utils import check_install
60+
check_install()
61+
6062
cmd = self._init_command('build')
6163

6264
# No image provided, default to use the client's loaded image

spython/main/execute.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ def execute(self,
4848
directories within your container using bind mounts
4949
5050
'''
51+
from spython.utils import check_install
52+
check_install()
53+
5154
cmd = self._init_command('exec')
52-
self._check_install()
5355

5456
# If the image is given as a list, it's probably the command
5557
if isinstance(image, list):

spython/main/help.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def help(self, command=None):
3333
command: the command to get help for, if none, prints general help
3434
3535
'''
36-
self._check_install()
36+
from spython.utils import check_install
37+
check_install()
3738

3839
cmd = ['singularity','--help']
3940
if command != None:

spython/main/inspect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def inspect(self,image=None, json=True, app=None):
3030
app: if defined, return help in context of an app
3131
3232
'''
33-
self._check_install()
33+
from spython.utils import check_install
34+
check_install()
3435

3536
# No image provided, default to use the client's loaded image
3637
if image is None:

0 commit comments

Comments
 (0)