def test_zero(self): res = duviz.bar(0, 'x') self.assertEqual(res, '')
def test_default(self): res = duviz.bar(10, 'abcd') self.assertEqual(res, '[--abcd--]')
def test_one(self): res = duviz.bar(1, "x", one="y") self.assertEqual(res, "y")
def test_one(self): res = duviz.bar(1, 'x', one='y') self.assertEqual(res, 'y')
def test_fill(self): res = duviz.bar(10, "abcd", fill="+") self.assertEqual(res, "[++abcd++]")
def test_zero(self): res = duviz.bar(0, "x") self.assertEqual(res, "")
def test_unicode(self): res = duviz.bar(10, 'åßc∂', fill='+') self.assertEqual(res, '[++åßc∂++]')
def test_unicode(self): res = duviz.bar(10, u'åßc∂', fill='+') self.assertEqual(res, u'[++åßc∂++]')
def test_unicode2(self): label = b'\xc3\xb8o\xcc\x82o\xcc\x88o\xcc\x81a\xcc\x8a'.decode('utf8') res = duviz.bar(9, label, fill='+') self.assertEqual(res, u'[+øôöóå+]')
def test_fill(self): res = duviz.bar(10, u'abcd', fill='+') self.assertEqual(res, u'[++abcd++]')
def test_left_and_right(self): res = duviz.bar(12, u'abcd', left='<<', right='**') self.assertEqual(res, u'<<--abcd--**')
def test_default(self): res = duviz.bar(10, u'abcd') self.assertEqual(res, u'[--abcd--]')
def test_left_and_right(self): res = duviz.bar(12, 'abcd', left='<<', right='**') self.assertEqual(res, '<<--abcd--**')
def test_default(self): res = duviz.bar(10, "abcd") self.assertEqual(res, "[--abcd--]")
def test_fill(self): res = duviz.bar(10, 'abcd', fill='+') self.assertEqual(res, '[++abcd++]')
def test_left_and_right(self): res = duviz.bar(12, "abcd", left="<<", right="**") self.assertEqual(res, "<<--abcd--**")
def test_unicode2(self): label = b'\xc3\xb8o\xcc\x82o\xcc\x88o\xcc\x81a\xcc\x8a'.decode('utf8') res = duviz.bar(9, label, fill='+') self.assertEqual(res, '[+øôöóå+]')