[Pkg-privacy-commits] [onionshare] 36/55: Make sure tests can find the correct paths (fixes #284)
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Sep 8 10:27:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch debian
in repository onionshare.
commit 115345477ac9d429aaa82bc2117f50cd518ab91e
Author: Micah Lee <micah at micahflee.com>
Date: Mon Sep 5 10:41:20 2016 -0700
Make sure tests can find the correct paths (fixes #284)
---
test/onionshare_strings_test.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/onionshare_strings_test.py b/test/onionshare_strings_test.py
index 5245a4a..7b588f2 100644
--- a/test/onionshare_strings_test.py
+++ b/test/onionshare_strings_test.py
@@ -17,9 +17,15 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
-import locale
+import locale, os
from onionshare import helpers, strings
+# Stub get_resource_path so it finds the correct path while running tests
+def get_resource_path(filename):
+ resources_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources')
+ path = os.path.join(resources_dir, filename)
+ return path
+helpers.get_resource_path = get_resource_path
def test_starts_with_empty_strings():
"""creates an empty strings dict by default"""
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git
More information about the Pkg-privacy-commits
mailing list