Пример #1
0
    def test_format_license_color(self, stdout):
        stdout.isatty.return_value = True

        good = license_info.format_license("foo", True)
        self.assertEqual(good, "\033[1m\033[32mfoo\033[0m")

        bad = license_info.format_license("bar", False)
        self.assertEqual(bad, "\033[1m\033[31mbar\033[0m")
Пример #2
0
    def test_format_license_piped(self, stdout):
        stdout.isatty.return_value = False

        good = license_info.format_license("foo", True)
        self.assertEqual(good, "foo")

        bad = license_info.format_license("bar", False)
        self.assertEqual(bad, "bar")
Пример #3
0
    def test_format_license_color(self, stdout):
        stdout.isatty.return_value = True

        good = license_info.format_license("foo", True)
        self.assertEqual(good, "\033[1m\033[32mfoo\033[0m")

        bad = license_info.format_license("bar", False)
        self.assertEqual(bad, "\033[1m\033[31mbar\033[0m")
Пример #4
0
    def test_format_license_piped(self, stdout):
        stdout.isatty.return_value = False

        good = license_info.format_license("foo", True)
        self.assertEqual(good, "foo")

        bad = license_info.format_license("bar", False)
        self.assertEqual(bad, "bar")
Пример #5
0
    def test_format_license_raw(self, stdout):
        good = license_info.format_license("qux", True)
        self.assertEqual(good, "qux")

        bad = license_info.format_license("ham", False)
        self.assertEqual(bad, "ham")
Пример #6
0
    def test_format_license_raw(self, stdout):
        good = license_info.format_license("qux", True)
        self.assertEqual(good, "qux")

        bad = license_info.format_license("ham", False)
        self.assertEqual(bad, "ham")