checkbox: add test loader for setuptools

This mimicks the same infrastructure from plainbox.tests. The test_suite()
method returns a TestSuite object that wraps all checkbox unit tests

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: use setuptools in setup.py

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: add test suite definition to setup.py

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: fix resource leaks in TestSubmissionParser

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: fix resource leaks in Template

The load_filename() and dump_filename() methods leak open file objects.
Those _may_ be closed eventually before the process terminates but
this is a bad practice and should never be done

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: fix resource leaks in SetupFiles

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: fix resource leaks in MessageFileFormatTest

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: fix resource leaks in TestXinputParser

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: s/assert(.+)Equals/assert\1Equal/g

This replaces the deprecated method assert...Equal*s* with the version
without the 's' at the end

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox: update gitignore

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"
"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"
"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"
Added xml exporter, and tweaked tests accordingly
"[r=zkrynicki,sylvain-pineau][bug=][author=roadmr] automatic merge by tarmac"
session: fix SessionState.resume() unicode/bytes

There are two changes: open the file in text mode and explicitly specify
encoding as UTF-8. This ensures we don't depend on locale (encoding) and
that we don't leak bytes around ('t')

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
session: fix SessionState.persistent_save()

This function created a NamedTemporaryFile in text mode without specifying
the encoding, thus it silently depended on locale to fall-back to UTF-8.
This broke in the SRU CI loop as seen in the following backtrace:

  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/sru.py", line 118, in _run_all_jobs
    self.session.persistent_save()
  File "/usr/lib/python3/dist-packages/plainbox/impl/session.py", line 566, in persistent_save
    ensure_ascii=False, indent=None, separators=(',', ':'))
  File "/usr/lib/python3.2/json/__init__.py", line 179, in dump
    fp.write(chunk)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 1-2: ordinal not in range(256)

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Add missing dependency on python3-setuptools

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Launchpad automatic translations update.
"[r=roadmr,zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"