Make get_all_exporters() return deterministic order

Previously the returned OrderedDictionary retained whatever ordering
was provided by the pkg_resources layer. Since we don't know what it
is and it turns out to differ between python3.2 and python3.3 let's
sort that by entry point name first.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"
Work around argparse bug in python3.3 and beyond

To quote the comment in the code:

    Argh the horrror!

    Since CPython revision cab204a79e09 (landed for python3.3)
    http://hg.python.org/cpython/diff/cab204a79e09/Lib/argparse.py
    the argparse module behaves differently than it did in python3.2

    In practical terms subparsers are now optional in 3.3 so all of the
    commands are no longer required parameters.

    To compensate, on python3.3 and beyond, when the user just runs
    plainbox without specifying the command, we manually, explicitly do
    what python3.2 did: call parser.error(_('too few arguments'))

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"
Add load_unit_tests() to plainbox.tests

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Refactor test_suite() to call load_unit_tests()

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Add load_integration_tests() to plainbox.tests

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Refactor integration test discovery

Use the discovery function from the plainbox.tests module

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Add -u | -i options to plainbox self-test

Those options allow the user to select either the integration test suite
or the unit test suite. Instead of using magic constant values we can
just store the function that needs to be called to load the desired type
of unit tests.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Fix test-with-coverage to use new arguments to self-test

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"[r=brendan-donegan][bug=][author=zkrynicki] Extend plainbox self-test to support running unit tests"