From 405e8cdd24cec10d9cc2ef0beb9604b36b77ba78 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 26 Jul 2019 16:05:58 -0500 Subject: [PATCH] added identify home test --- onionr/tests/test_identifyhome.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 onionr/tests/test_identifyhome.py diff --git a/onionr/tests/test_identifyhome.py b/onionr/tests/test_identifyhome.py new file mode 100644 index 00000000..1e649fb6 --- /dev/null +++ b/onionr/tests/test_identifyhome.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import sys, os +sys.path.append(".") +import unittest, uuid +from utils import identifyhome + +class IdentifyHomeTest(unittest.TestCase): + def test_standard_linux(self): + del os.environ["ONIONR_HOME"] + self.assertEqual(identifyhome.identify_home(), os.path.expanduser('~') + '/.local/share/onionr/') + def test_environ(self): + os.environ["ONIONR_HOME"] = "testhome" + self.assertEqual(os.getcwd() + "/testhome/", identifyhome.identify_home()) + +unittest.main() \ No newline at end of file