diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-07 14:10:31 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2013-01-22 09:05:10 (GMT) |
commit | 400117171011642c844f06c7a6e48c88746953a4 (patch) | |
tree | fa34c62c8188dd4e33321ba827da8f21aa52174a | |
parent | 86759e4ebd1aa506a536854156f978e38eac22a0 (diff) |
Allow to run tests without installing
It's the common, expected behavior of unit tests and it makes
development faster.
Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | tests/test_activitieslist.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index d024f44..2c406f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,5 @@ TESTS_TMPDIR=$(abs_builddir)/tests-tmp +TESTS_PYTHONPATH=$(abs_srcdir)/src:$(PYTHONPATH) SUBDIRS = bin data po src extensions @@ -18,5 +19,6 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-update-mimedb test: cd $(top_srcdir)/tests && \ mkdir -p $(TESTS_TMPDIR) && \ - TMPDIR=$(TESTS_TMPDIR) python -m unittest discover && \ + TMPDIR=$(TESTS_TMPDIR) PYTHONPATH=$(TESTS_PYTHONPATH) \ + python -m unittest discover && \ rm -rf $(TESTS_TMPDIR) diff --git a/tests/test_activitieslist.py b/tests/test_activitieslist.py index c5d13ab..a5a2e7c 100644 --- a/tests/test_activitieslist.py +++ b/tests/test_activitieslist.py @@ -20,8 +20,14 @@ import unittest from jarabe.desktop.activitieslist import ActivityListPalette tests_dir = os.path.dirname(__file__) +base_dir = os.path.dirname(tests_dir) data_dir = os.path.join(tests_dir, "data") +os.environ["SUGAR_ACTIVITIES_DEFAULTS"] = \ + os.path.join(base_dir, "data", "activities.defaults") +os.environ["SUGAR_MIME_DEFAULTS"] = \ + os.path.join(base_dir, "data", "mime.defaults") + class MockActivityInfo: def get_bundle_id(self): return "mock" |