diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-07 14:10:31 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-14 10:27:48 (GMT) |
commit | 1339bad98ecd28a7227cc43ae32b01f8ad01fda3 (patch) | |
tree | 29b87bdbf693f95e3a854dc37602a2bbb612d8c8 | |
parent | 8855445f81641aeb10504594fb88854de3324999 (diff) |
Allow to run tests without installing
It's the common, expected behavior of unit tests and it makes
development faster.
-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" |