Error Details
AssertionError: assert {'@id': 2647,... False, ...}}} == {'@id': 2647,...9c4d909', ...}
Omitting 4 identical items, use -vv to show
Right contains 1 more item:
{'Experimenters': [{'@id': 3653,
'@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#Experimenter',
'FirstName': '<hidden>',
'LastName': '<hidden>',
'UserName': '<hidden>',
'omero:details': {'@type': 'TBD#Details',
'permissions': {'@type': 'TBD#Permissions',
'canAnnotate': True,
'canDelete': False,
'canEdit': False,
'canLink': True,
'isGroupAnnotate': False,
'isGroupRead': False,
'isGroupWrite': False,
'isUserRead': True,
'isUserWrite': True,
'isWorldRead': False,
'isWorldWrite': False,
'perm': 'rw----'}},
'omero:owner': False}]}
Full diff:
{
'@id': 2647,
'@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#ExperimenterGroup',
- 'Experimenters': [
- {
- '@id': 3653,
- '@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#Experimenter',
- 'FirstName': '<hidden>',
- 'LastName': '<hidden>',
- 'UserName': '<hidden>',
- 'omero:details': {
- '@type': 'TBD#Details',
- 'permissions': {
- '@type': 'TBD#Permissions',
- 'canAnnotate': True,
- 'canDelete': False,
- 'canEdit': False,
- 'canLink': True,
- 'isGroupAnnotate': False,
- 'isGroupRead': False,
- 'isGroupWrite': False,
- 'isUserRead': True,
- 'isUserWrite': True,
- 'isWorldRead': False,
- 'isWorldWrite': False,
- 'perm': 'rw----',
- },
- },
- 'omero:owner': False,
- },
- ],
'Name': '0009d54e-b320-4f11-93e1-531759c4d909',
'omero:details': {
'@type': 'TBD#Details',
'permissions': {
'@type': 'TBD#Permissions',
'canAnnotate': True,
'canDelete': False,
'canEdit': False,
'canLink': True,
'isGroupAnnotate': False,
'isGroupRead': False,
'isGroupWrite': False,
'isUserRead': True,
'isUserWrite': True,
'isWorldRead': False,
'isWorldWrite': False,
'perm': 'rw----',
},
},
}Stack Trace
self = <test_api_experimenters_groups.TestExperimenters object at 0x7f9b0e03fb90>
user1 = (<omero.clients.BaseClient object at 0x7f9b095dc890>, object #0 (::omero::model::Experimenter)
{
_id = object #1 (...nnotationLinksSeq =
{
}
_annotationLinksLoaded = False
_annotationLinksCountPerOwner =
{
}
})
def test_groups_experimenters(self, user1):
"""
Test listing groups.
We simply list existing Groups since we have no way to filter
and show only those created in the test.
"""
conn = get_connection(user1)
user_name = conn.getUser().getName()
django_client = self.new_django_client(user_name, user_name)
request_url = reverse(
'api_experimentergroups',
kwargs={'api_version': api_settings.API_VERSIONS[-1]})
data = {'limit': 10}
rsp = get_json(django_client, request_url, data)
groups_json = rsp['data']
query = """select obj from ExperimenterGroup as obj order by
lower(obj.name), obj.id"""
params = ParametersI()
params.page(0, 10)
groups = conn.getQueryService().findAllByQuery(query, params)
> assert_objects(conn, groups_json, groups, dtype="ExperimenterGroup")
test/integration/test_api_experimenters_groups.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
conn = <omero.gateway._BlitzGateway object at 0x7f9ae810f510>
json_objects = [{'@id': 2647, '@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#ExperimenterGroup', 'Name': '0009d54e-b320-...permissions': {'@type': 'TBD#Permissions', 'canAnnotate': True, 'canDelete': False, 'canEdit': False, ...}}, ...}, ...]
omero_ids_objects = [object #0 (::omero::model::ExperimenterGroup)
{
_id = object #1 (::omero::RLong)
{
_val = 2647
}
... }
_annotationLinksLoaded = False
_annotationLinksCountPerOwner =
{
}
_description = <nil>
}, ...]
dtype = 'ExperimenterGroup', group = '-1', extra = None, opts = None
client = None
def assert_objects(conn, json_objects, omero_ids_objects, dtype="Project",
group='-1', extra=None, opts=None, client=None):
"""
Load objects from OMERO, via conn.getObjects().
marshal with omero_marshal and compare with json_objects.
omero_ids_objects can be IDs or list of omero.model objects.
@param: extra List of dicts containing expected extra json data
e.g. {'omero:childCount': 1}
"""
pids = []
for p in omero_ids_objects:
try:
pids.append(int(p))
except TypeError:
pids.append(p.id.val)
conn.SERVICE_OPTS.setOmeroGroup(group)
objs = conn.getObjects(dtype, pids, respect_order=True, opts=opts)
objs = [p._obj for p in objs]
expected = marshal_objects(objs)
assert len(json_objects) == len(expected)
for i, o1, o2 in zip(list(range(len(expected))), json_objects, expected):
if extra is not None and i < len(extra):
o2.update(extra[i])
# remove any urls from json, if not in both objects
o1 = copy.deepcopy(o1) # don't modify original
for key in list(o1.keys()):
if key.startswith('url:') and key not in o2:
del o1[key]
# add urls to any 'Image' in expected 'Wells' dict
add_image_urls(o2, client)
> assert o1 == o2
E AssertionError: assert {'@id': 2647,... False, ...}}} == {'@id': 2647,...9c4d909', ...}
E
E Omitting 4 identical items, use -vv to show
E Right contains 1 more item:
E {'Experimenters': [{'@id': 3653,
E '@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#Experimenter',
E 'FirstName': '<hidden>',
E 'LastName': '<hidden>',
E 'UserName': '<hidden>',
E 'omero:details': {'@type': 'TBD#Details',
E 'permissions': {'@type': 'TBD#Permissions',
E 'canAnnotate': True,
E 'canDelete': False,
E 'canEdit': False,
E 'canLink': True,
E 'isGroupAnnotate': False,
E 'isGroupRead': False,
E 'isGroupWrite': False,
E 'isUserRead': True,
E 'isUserWrite': True,
E 'isWorldRead': False,
E 'isWorldWrite': False,
E 'perm': 'rw----'}},
E 'omero:owner': False}]}
E
E Full diff:
E {
E '@id': 2647,
E '@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#ExperimenterGroup',
E - 'Experimenters': [
E - {
E - '@id': 3653,
E - '@type': 'http://www.openmicroscopy.org/Schemas/OME/2016-06#Experimenter',
E - 'FirstName': '<hidden>',
E - 'LastName': '<hidden>',
E - 'UserName': '<hidden>',
E - 'omero:details': {
E - '@type': 'TBD#Details',
E - 'permissions': {
E - '@type': 'TBD#Permissions',
E - 'canAnnotate': True,
E - 'canDelete': False,
E - 'canEdit': False,
E - 'canLink': True,
E - 'isGroupAnnotate': False,
E - 'isGroupRead': False,
E - 'isGroupWrite': False,
E - 'isUserRead': True,
E - 'isUserWrite': True,
E - 'isWorldRead': False,
E - 'isWorldWrite': False,
E - 'perm': 'rw----',
E - },
E - },
E - 'omero:owner': False,
E - },
E - ],
E 'Name': '0009d54e-b320-4f11-93e1-531759c4d909',
E 'omero:details': {
E '@type': 'TBD#Details',
E 'permissions': {
E '@type': 'TBD#Permissions',
E 'canAnnotate': True,
E 'canDelete': False,
E 'canEdit': False,
E 'canLink': True,
E 'isGroupAnnotate': False,
E 'isGroupRead': False,
E 'isGroupWrite': False,
E 'isUserRead': True,
E 'isUserWrite': True,
E 'isWorldRead': False,
E 'isWorldWrite': False,
E 'perm': 'rw----',
E },
E },
E }
test/integration/test_api_containers.py:99: AssertionError