示例#1
0
 def test_getConfigStorageRootPath_Windows(self):
     config_root_path = Resources._getConfigStorageRootPath()
     expected_config_root_path = os.getenv("APPDATA")
     self.assertEqual(
         expected_config_root_path, config_root_path,
         "expected %s, got %s" %
         (expected_config_root_path, config_root_path))
示例#2
0
 def test_getConfigStorageRootPath_Mac(self):
     config_root_path = Resources._getConfigStorageRootPath()
     expected_config_root_path = os.path.expanduser(
         "~/Library/Application Support")
     self.assertEqual(
         expected_config_root_path, config_root_path,
         "expected %s, got %s" %
         (expected_config_root_path, config_root_path))
示例#3
0
    def test_getConfigStorageRootPath_Mac(self):
        if platform.system() != "Darwin":
            self.skipTest("not on mac")

        config_root_path = Resources._getConfigStorageRootPath()
        expected_config_root_path = os.path.expanduser("~/Library/Application Support")
        self.assertEqual(expected_config_root_path, config_root_path,
                         "expected %s, got %s" % (expected_config_root_path, config_root_path))
示例#4
0
    def test_getConfigStorageRootPath_Windows(self):
        if platform.system() != "Windows":
            self.skipTest("not on Windows")

        config_root_path = Resources._getConfigStorageRootPath()
        expected_config_root_path = os.getenv("APPDATA")
        self.assertEqual(expected_config_root_path, config_root_path,
                         "expected %s, got %s" % (expected_config_root_path, config_root_path))
示例#5
0
    def test_getConfigStorageRootPath_Linux(self):
        if platform.system() != "Linux":
            self.skipTest("not on Linux")

        # no XDG_CONFIG_HOME defined
        if "XDG_CONFIG_HOME" in os.environ:
            del os.environ["XDG_CONFIG_HOME"]
        config_root_path = Resources._getConfigStorageRootPath()
        expected_config_root_path = os.path.expanduser("~/.config")
        self.assertEqual(expected_config_root_path, config_root_path,
                         "expected %s, got %s" % (expected_config_root_path, config_root_path))

        # XDG_CONFIG_HOME defined
        os.environ["XDG_CONFIG_HOME"] = "/tmp"
        config_root_path = Resources._getConfigStorageRootPath()
        expected_config_root_path = "/tmp"
        self.assertEqual(expected_config_root_path, config_root_path,
                         "expected %s, got %s" % (expected_config_root_path, config_root_path))