Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change all tests under integration to use pytest idioms. #1559

Merged
merged 25 commits into from
Oct 7, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
11f8512
Change assertions semi-automatically.
ximenesuk Sep 20, 2013
f48b4aa
Further manual changes to assertions
ximenesuk Sep 20, 2013
45aaada
Use pytest idiom to assert exceptions.
ximenesuk Sep 20, 2013
42f261f
Remove self.fail in favour of assert False.
ximenesuk Sep 27, 2013
09c32d9
Remove erroneous test file.
ximenesuk Sep 27, 2013
015fc83
Fix various imports and remove unittest from all test files.
ximenesuk Sep 27, 2013
8589955
test_client_ctors is a special case that doesn't use lib.ITest
ximenesuk Sep 27, 2013
f1d6f77
Switch the library from unittest to pytest.
ximenesuk Sep 27, 2013
172ff7a
Override setup in imetadata test.
ximenesuk Sep 27, 2013
7975ee6
Expose tests in annotationPermissions and override fixtures.
ximenesuk Sep 27, 2013
d8abe65
Change tests in subdirectories to pytest.
ximenesuk Sep 27, 2013
e84b29e
Fix make movie test.
ximenesuk Sep 27, 2013
65b2581
Move table tests to pytest.
ximenesuk Sep 27, 2013
eeb77d7
Remove unecessary output from bigImages test and use assertion.
ximenesuk Sep 30, 2013
6d63214
Change missed assertEquals
ximenesuk Sep 30, 2013
db078cd
Modify thumbnail perms tests to resolve conflicts.
ximenesuk Sep 30, 2013
826f163
Change assertTrue to assert in recently added test.
ximenesuk Oct 2, 2013
ab257a6
Switch unit tests to use pytest idioms throughout.
ximenesuk Oct 2, 2013
b715c83
Removing unused library and helper files.
ximenesuk Oct 2, 2013
61c46af
Mark failing tests, see #11494
ximenesuk Oct 2, 2013
5765db7
Mark performance test that regularly, see #11494
ximenesuk Oct 3, 2013
ca0a7ec
Remove omero.user from various tests.
ximenesuk Oct 3, 2013
64043bc
Tests affected by the fixes to #11465
ximenesuk Oct 3, 2013
3cafdec
Remove Python bfpixels tests. See #11500
ximenesuk Oct 4, 2013
f1629da
Add MARK parameter to "integration" target.
Oct 2, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.