openmicroscopy/openmicroscopy — pull request #1903 by sbesson (2013-12-15 13:50:20+00:00)
Title: CLI tag plugin: bug fixes

This PR addresses https://trac.openmicroscopy.org.uk/ome/ticket/11817 by:
- modifying the help of the `tag` argument in `bin/omero createset -h` to make it clear tag IDs are expected
- enforcing the argument type to `long` wherever necessary for all subcommands of the tag plugin.

As a bonus effect, the latter change also fixes `bin/omero tag link` subcommand which was failing for all versions of Ice but 3.4 with the following stacktrace:

```
Traceback (most recent call last):
File "OMERO.server-5.0.0-beta2-RC3-ice33-b9/bin/omero", line 125, in
rv = omero.cli.argv()
File "/fc/homes/sbesson/OMERO.server-5.0.0-beta2-RC3-ice33-b9/lib/python/omero/cli.py", line 1195, in argv
cli.invoke(args[1:])
File "/fc/homes/sbesson/OMERO.server-5.0.0-beta2-RC3-ice33-b9/lib/python/omero/cli.py", line 745, in invoke
stop = self.onecmd(line, previous_args)
File "/fc/homes/sbesson/OMERO.server-5.0.0-beta2-RC3-ice33-b9/lib/python/omero/cli.py", line 814, in onecmd
self.execute(line, previous_args)
File "/fc/homes/sbesson/OMERO.server-5.0.0-beta2-RC3-ice33-b9/lib/python/omero/cli.py", line 894, in execute
args.func(args)
File "/fc/homes/sbesson/OMERO.server-5.0.0-beta2-RC3-ice33-b9/lib/python/omero/plugins/tag.py", line 580, in link
annotation = query_service.find("TagAnnotation", tag_id)
File "/fc/homes/sbesson/OMERO.server-5.0.0-beta2-RC3-ice33-b9/lib/python/omero_api_IQuery_ice.py", line 97, in find
return _M_omero.api.IQuery._op_find.invoke(self, ((klass, id), _ctx))
ValueError: invalid value for argument 2 in operation `find'
```

The tests for the tag plugin are also reviewed and optimised:
- the `tag create`, `tag createset` and `tag link` subcommand tests now use parametrisation
- some of the tests are moved from integration to unit tests (help subcommand, fast-fail with wrong input)