[PATCH 0/7] Python unit tests - request for comments



Hi all,

This is an initial draft for the Python unit tests. The infrastructure
has been updated to make them being invoked when doing make test,
and to skip them if introspection support isn't available.

However, I'm not satisfied with the setUp / tearDown part: since we
cannot unload/reload the plugins, if I load all the plugins for a test,
they're present in the next one. As I thought of some of the tests
with the unload/reload idea in my mind, they don't make much sense right now.

If you run the tests (you'll need to build Grilo with introspection support), you'll
see that some of them fail (at least a get_version method for the plugins, and two
involving metadata_keys). The latter are due to a bug in PyGObject's handling of
GParamSpec (#629552). The former may be caused by a function missing its implementation.

About the setUp/tearDown, I'm open for suggestions: maybe we should let the tests fail
until we change/fix the plugin load system, or just try a different workaround. And about the
tests themselves, they're pretty simple right now, and are mostly focused on testing GI's
support, more than functionality.

Cheers,

Simon

Simón Pena (7):
  core: Updated infrastructure to support python tests
  tests: Tested the PluginRegistry class using GI
  tests: Tested the PluginMedia class using GI
  tests: Tested the MetadataSource class using GI
  tests: Command line arguments can be passed to testrunner
  core: Moved tests infrastructure to /tests
  tests: Removed setUp/tearDown code in python tests

 Makefile.am                          |    2 +-
 configure.ac                         |    4 +-
 src/Makefile.am                      |    2 -
 src/tests/.gitignore                 |    1 -
 src/tests/Makefile.am                |   63 --------------
 src/tests/registry.c                 |  150 --------------------------------
 tests/Makefile.am                    |   60 +++++++++++++
 tests/python/Makefile.am             |   16 ++++
 tests/python/constants.py            |   50 +++++++++++
 tests/python/test_metadata_source.py |   94 ++++++++++++++++++++
 tests/python/test_plugin.py          |   72 ++++++++++++++++
 tests/python/test_registry.py        |  157 ++++++++++++++++++++++++++++++++++
 tests/python/testrunner.py           |   27 ++++++
 tests/python/util.py.in              |    9 ++
 tests/registry.c                     |  149 ++++++++++++++++++++++++++++++++
 15 files changed, 638 insertions(+), 218 deletions(-)
 delete mode 100644 src/tests/.gitignore
 delete mode 100644 src/tests/Makefile.am
 delete mode 100644 src/tests/registry.c
 create mode 100644 tests/Makefile.am
 create mode 100644 tests/python/Makefile.am
 create mode 100644 tests/python/constants.py
 create mode 100644 tests/python/test_metadata_source.py
 create mode 100644 tests/python/test_plugin.py
 create mode 100644 tests/python/test_registry.py
 create mode 100755 tests/python/testrunner.py
 create mode 100644 tests/python/util.py.in
 create mode 100644 tests/registry.c



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]