Example #1
0
    def test_make_code_with_opts(self):
        "ensure use of optional formats"
        actual = chalk.make_code('green', 'magenta', opts='bold')
        expected = '\x1b[1;32;45m'
        self.assertEqual(actual, expected)

        actual = chalk.make_code('black', 'white', opts=('bold', 'underscore'))
        expected = '\x1b[1;4;30;47m'
        self.assertEqual(actual, expected)

        self.assertRaises(TypeError, chalk.make_code, ('black', 'white'),
                          {'opts': ('bold')})
Example #2
0
    def test_make_code_with_opts(self):
        "ensure use of optional formats"
        actual = chalk.make_code('green', 'magenta', opts='bold')
        expected = '\x1b[1;32;45m'
        self.assertEqual(actual, expected)

        actual = chalk.make_code('black', 'white', opts=('bold', 'underscore'))
        expected = '\x1b[1;4;30;47m'
        self.assertEqual(actual, expected)

        self.assertRaises(
            TypeError, chalk.make_code, ('black', 'white'), {'opts': ('bold')}
        )
Example #3
0
 def test_make_code_basic_use(self):
     "ensure basic functionality"
     actual = chalk.make_code('red', 'blue')
     expected = '\x1b[31;44m'
     self.assertEqual(actual, expected)
Example #4
0
 def test_make_code_basic_use(self):
     "ensure basic functionality"
     actual = chalk.make_code('red', 'blue')
     expected = '\x1b[31;44m'
     self.assertEqual(actual, expected)