示例#1
0
    def test_getDataStorageRootPath_Mac(self):
        if platform.system() != "Darwin":
            self.skipTest("not on mac")

        data_root_path = Resources._getDataStorageRootPath()
        self.assertIsNone(data_root_path,
                          "expected None, got %s" % data_root_path)
示例#2
0
    def test_getDataStorageRootPath_Linux(self):
        # no XDG_CONFIG_HOME defined
        if "XDG_DATA_HOME" in os.environ:
            del os.environ["XDG_DATA_HOME"]
        data_root_path = Resources._getDataStorageRootPath()
        expected_data_root_path = os.path.expanduser("~/.local/share")
        self.assertEqual(
            expected_data_root_path, data_root_path,
            "expected %s, got %s" % (expected_data_root_path, data_root_path))

        # XDG_CONFIG_HOME defined
        os.environ["XDG_DATA_HOME"] = "/tmp"
        data_root_path = Resources._getDataStorageRootPath()
        expected_data_root_path = "/tmp"
        self.assertEqual(
            expected_data_root_path, data_root_path,
            "expected %s, got %s" % (expected_data_root_path, data_root_path))
示例#3
0
    def test_getDataStorageRootPath_Linux(self):
        if platform.system() != "Linux":
            self.skipTest("not on Linux")

        # no XDG_CONFIG_HOME defined
        if "XDG_DATA_HOME" in os.environ:
            del os.environ["XDG_DATA_HOME"]
        data_root_path = Resources._getDataStorageRootPath()
        expected_data_root_path = os.path.expanduser("~/.local/share")
        self.assertEqual(expected_data_root_path, data_root_path,
                         "expected %s, got %s" % (expected_data_root_path, data_root_path))

        # XDG_CONFIG_HOME defined
        os.environ["XDG_DATA_HOME"] = "/tmp"
        data_root_path = Resources._getDataStorageRootPath()
        expected_data_root_path = "/tmp"
        self.assertEqual(expected_data_root_path, data_root_path,
                         "expected %s, got %s" % (expected_data_root_path, data_root_path))
示例#4
0
 def test_getDataStorageRootPath_Mac(self):
     data_root_path = Resources._getDataStorageRootPath()
     self.assertIsNone(data_root_path,
                       "expected None, got %s" % data_root_path)
示例#5
0
    def test_getDataStorageRootPath_Mac(self):
        if platform.system() != "Darwin":
            self.skipTest("not on mac")

        data_root_path = Resources._getDataStorageRootPath()
        self.assertIsNone(data_root_path, "expected None, got %s" % data_root_path)