summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2016-09-05 10:41:20 -0700
committerMicah Lee <micah@micahflee.com>2016-09-05 10:41:20 -0700
commit115345477ac9d429aaa82bc2117f50cd518ab91e (patch)
treedf2c320d022394e8d257094d25f301a8b17f6af4
parent22f104cf652f1eeeda46fa7482dfa65c0a0d3840 (diff)
downloadonionshare-115345477ac9d429aaa82bc2117f50cd518ab91e.tar.gz
onionshare-115345477ac9d429aaa82bc2117f50cd518ab91e.zip
Make sure tests can find the correct paths (fixes #284)
-rw-r--r--test/onionshare_strings_test.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/onionshare_strings_test.py b/test/onionshare_strings_test.py
index 5245a4a1..7b588f29 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"""