def test_is(self):
        """Check that system identification works as expected on Linux."""
        platform = Platform(self.sys)

        self.assertTrue(platform.is_linux)
        self.assertFalse(platform.is_osx)
        self.assertFalse(platform.is_windows)
    def test_is(self):
        """Check that system identification works as expected for an unrecognized operating system."""
        platform = Platform(self.sys)

        self.assertFalse(platform.is_linux)
        self.assertFalse(platform.is_osx)
        self.assertFalse(platform.is_windows)
    def test_supports_color(self):
        """Check that color support does not work for ANSICON."""
        platform = Platform(self.sys)

        with modified_environ(ANSICON="present"):
            self.assertFalse(platform.supports_color)

        self.assertFalse(platform.supports_color)
    def test_is_python(self):
        """Check that Python version identification works as expected."""
        platform = Platform(self.sys)

        # noinspection PyUnresolvedReferences
        with patch.object(self.sys, "version_info") as version_info:
            version_info.major = 2
            self.assertTrue(platform.is_python2)

        # noinspection PyUnresolvedReferences
        with patch.object(self.sys, "version_info") as version_info:
            version_info.major = 3
            self.assertTrue(platform.is_python3)
    def test_supports_color(self):
        """Check that color support works as expected on Linux."""
        platform = Platform(self.sys)

        self.assertTrue(platform.supports_color)
    def test_get_temp_path(self):
        """Check the path for temporary application data on Linux."""
        platform = Platform(self.sys)

        self.assertTrue(".cache" in platform.get_temp_path())
    def test_get_configuration_path(self):
        """Check the path for persistent application data on Linux."""
        platform = Platform(self.sys)

        self.assertTrue(".config" in platform.get_configuration_path())
    def test_get_temp_path(self):
        """Check the path for temporary application data on OS X."""
        platform = Platform(self.sys)

        self.assertTrue("Library/Caches" in platform.get_temp_path())
    def test_get_configuration_path(self):
        """Check the path for persistent application data on OS X."""
        platform = Platform(self.sys)

        self.assertTrue(
            "Library/Application Support" in platform.get_configuration_path())
Пример #10
0
    def test_supports_color(self):
        """Check that color support does not work for Windows."""
        platform = Platform(self.sys)

        self.assertFalse(platform.supports_color)
Пример #11
0
    def test_get_temp_path(self):
        """Check the path for temporary application data on Windows."""
        platform = Platform(self.sys)

        self.assertTrue("Locals" in platform.get_temp_path())
Пример #12
0
    def test_get_temp_path(self):
        """Check the path for temporary application data for an unrecognized operating system."""
        platform = Platform(self.sys)

        self.assertRaises(NotImplementedError, platform.get_temp_path)