Skip to content

Commit

Permalink
Merge pull request #1559 from ximenesuk/pytest-integration
Browse files Browse the repository at this point in the history
Change all tests under integration to use pytest idioms.
  • Loading branch information
joshmoore committed Oct 7, 2013
2 parents 664e528 + f1629da commit 39fb18c
Show file tree
Hide file tree
Showing 92 changed files with 1,647 additions and 2,470 deletions.
4 changes: 3 additions & 1 deletion components/tools/OmeroPy/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

<target name="test" depends="python-test" unless="env.NOPYTHON"/>

<target name="integration" depends="python-integration" unless="env.NOPYTHON"/>
<target name="integration" depends="python-integration" unless="env.NOPYTHON">
<property name="MARK" value=""/>
</target>

<target name="tools-init" unless="env.NOPYTHON">
<get-source todir="${copy.dir}">
Expand Down
16 changes: 0 additions & 16 deletions components/tools/OmeroPy/test/gatewaytest/library.py

This file was deleted.

62 changes: 0 additions & 62 deletions components/tools/OmeroPy/test/gatewaytest/pytest_convert.py

This file was deleted.

1 change: 0 additions & 1 deletion components/tools/OmeroPy/test/gatewaytest/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def testExport (self, gatewaywrapper):
finally:
gatewaywrapper.loginAsAdmin()
admin = gatewaywrapper.gateway.getAdminService()
admin.removeGroups(omero.model.ExperimenterI(uid, False), [g])



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def searchHistory(self, gateway, start, end, dtype="Dataset"):
assert typeCount == dataCount, "Period count should match number of objects"
assert logCount == dataCount, "Logs count should match number of objects"


@pytest.mark.xfail(reason="ticket 11494")
def testCreateHistory(self, gatewaywrapper):

# Login as user...
Expand Down
3 changes: 3 additions & 0 deletions components/tools/OmeroPy/test/gatewaytest/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
"""

import pytest
import omero
import time


from omero.rtypes import rstring, rlong

class TestPerformance (object):

@pytest.mark.xfail(reason="ticket 11494")
def testListFileAnnotations(self, gatewaywrapper):
""" testListFileAnnotations: test speed of getObjects('FileAnnotation') vv listFileAnnotations() """
gatewaywrapper.loginAsAuthor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def dynamic_test(self, perms=perms, testertype=testertype,
conn.SERVICE_OPTS.setOmeroGroup(str(-1))

img = conn.getObject("Image", image.id)
self.assertTrue(img.getThumbnail(size=size, direct=direct))
assert img.getThumbnail(size=size, direct=direct)

test_name = "test_%s_%s_dir%s_grp%s_%s" % \
(perms, testertype, direct, grpctx, size)
Expand Down
1 change: 0 additions & 1 deletion components/tools/OmeroPy/test/gatewaytest/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def testCrossGroupSave (self, gatewaywrapper):
admin = gatewaywrapper.gateway.getAdminService()
# Revert group permissions and remove user from group
admin.changePermissions(g._obj, omero.model.PermissionsI(perms))
admin.removeGroups(omero.model.ExperimenterI(uid, False), [g._obj])

def testCrossGroupRead (self, gatewaywrapper):
gatewaywrapper.loginAsAuthor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"""

import unittest, os, subprocess, StringIO
import os, subprocess, StringIO
from path import path
from omero.cli import Context, BaseControl, CLI
from omero.plugins.script import ScriptControl
from omero.plugins.sessions import SessionsControl
from omero.plugins.upload import UploadControl
from omero.util.temp_files import create_path
from integration.library import ITest
import test.integration.library as lib

omeroDir = path(os.getcwd()) / "build"


class TestScript(ITest):
class TestScript(lib.ITest):

def cli(self):
cli = CLI()
Expand Down Expand Up @@ -100,6 +100,3 @@ def testReplaceOfficial(self):
replaceArgs = args + ["replace", str(newId), str(p)]
# print replaceArgs
cli.invoke(replaceArgs, strict=True)

if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
"""

import omero
import unittest
import test.integration.library as lib

from integration.library import ITest
from omero.callbacks import CmdCallbackI


class ChgrpTest(ITest):
class ChgrpTest(lib.ITest):

def testChgrpImage(self):

Expand All @@ -39,6 +38,3 @@ def testChgrpImage(self):

# Check Data
query.get("Image", img.id.val)

if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
"""

import omero
import unittest
import test.integration.library as lib

from integration.library import ITest
from omero.callbacks import CmdCallbackI


class ColumbusTest(unittest.TestCase):
class ColumbusTest(lib.ITest):
"""
The following tests all assume the following
user configuration:
Expand Down Expand Up @@ -157,6 +156,3 @@ def test10(self):
group admin b:D should not have access to data that is owned by A and
only shared with users in group b but not with group b.
"""

if __name__ == '__main__':
unittest.main()
56 changes: 0 additions & 56 deletions components/tools/OmeroPy/test/integration/cmdtest/test_example.py

This file was deleted.

0 comments on commit 39fb18c

Please sign in to comment.