forked from ome/openmicroscopy
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ome#2317 from ximenesuk/flake8-sub-fixes
Flake8 fixes of integration tests
- Loading branch information
Showing
14 changed files
with
412 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 29 additions & 16 deletions
45
components/tools/OmeroPy/test/integration/scriptsharness/definition.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# | ||
# Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved. | ||
# Use is subject to license terms supplied in LICENSE.txt | ||
# | ||
# $Id$ | ||
# This program 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. | ||
# | ||
# Copyright 2008-2013 Glencoe Software, Inc. All rights reserved. | ||
# Use is subject to license terms supplied in LICENSE.txt | ||
# This program 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 this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
import sys | ||
import types | ||
|
||
import omero, omero.scripts as sc | ||
import omero | ||
import omero.scripts as sc | ||
|
||
client = sc.client("script_1", """ | ||
This is a test script used to test the basic parsing functionality | ||
and attempts to interaction with the server | ||
""", | ||
#sc.Int("myint"), | ||
sc.Long("mylong"), | ||
sc.Bool("mybool"), | ||
sc.String("mystring"), | ||
sc.String("myoptional",optional=True) | ||
) | ||
sc.Int("myint"), | ||
sc.Long("mylong"), | ||
sc.Bool("mybool"), | ||
sc.String("mystring"), | ||
sc.String("myoptional", optional=True) | ||
) | ||
|
||
import os, sys, types | ||
assert type(client) == types.TupleType | ||
assert isinstance(client, types.TupleType) | ||
|
||
self = sys.argv[0] | ||
cfg = self.replace("py","cfg") | ||
self = sys.argv[0] | ||
cfg = self.replace("py", "cfg") | ||
|
||
real_client = omero.client(["--Ice.Config=%s" % cfg]) | ||
parse_only = real_client.getProperty("omero.script.parse") | ||
assert parse_only == "true" | ||
|
||
|
24 changes: 0 additions & 24 deletions
24
components/tools/OmeroPy/test/integration/scriptsharness/harness.py
This file was deleted.
Oops, something went wrong.
25 changes: 19 additions & 6 deletions
25
components/tools/OmeroPy/test/integration/scriptsharness/simple_script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# | ||
# Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved. | ||
# Use is subject to license terms supplied in LICENSE.txt | ||
# | ||
# This program 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. | ||
# | ||
# This program 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 this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
""" | ||
Minimal script to test the {g,s}et{In,Out}put functionality | ||
of omero.client | ||
Copyright 2008-2013 Glencoe Software, Inc. All rights reserved. | ||
Use is subject to license terms supplied in LICENSE.txt | ||
""" | ||
|
||
import omero.scripts | ||
|
||
client = omero.scripts.client("test_harness") | ||
pixelsID = client.getInput("pixelsID") | ||
client.setOutput("newPixelsID",-1) | ||
|
||
|
||
client.setOutput("newPixelsID", -1) |
44 changes: 44 additions & 0 deletions
44
components/tools/OmeroPy/test/integration/scriptsharness/test_harness.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# | ||
# Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved. | ||
# Use is subject to license terms supplied in LICENSE.txt | ||
# | ||
# This program 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. | ||
# | ||
# This program 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 this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
""" | ||
Harness for calling scripts via `omero script` | ||
of omero.client | ||
""" | ||
|
||
import omero.cli | ||
import test.integration.library as lib | ||
|
||
|
||
def call(*args): | ||
omero.cli.argv(["omero", "script"] + list(args)) | ||
|
||
|
||
class TestScriptsViaOmeroCli(lib.ITest): | ||
|
||
def testDefinition(self): | ||
call("test/scripts/definition.py", | ||
"--Ice.Config=test/scripts/definition.cfg") | ||
|
||
def testSimpleScript(self): | ||
call("test/scripts/simple_script.py", | ||
"--Ice.Config=test/scripts/simple_script.cfg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.