Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_chart_multiple_series_different_scale_prints_correctly(self):
with patch('sys.stdout', new=StringIO()) as output:
colors = [91, 94]
data = [[183.32, 190.52], [231.23, 5.0], [16.43, 53.1], [50.21, 7.0],
[508.97, 10.45], [212.05, 20.2], [30.0, 20.0]]
args = {'filename': 'data/ex4.dat', 'title': None, 'width': 50,
'format': '{:<5.2f}', 'suffix': '', 'no_labels': False,
'color': None, 'vertical': False, 'stacked': False,
'different_scale': True, 'calendar': False,
'start_dt': None, 'custom_tick': '', 'delim': '',
'verbose': False, 'version': False}
labels = ['2007', '2008', '2009', '2010', '2011', '2012', '2014']
tg.chart(colors, data, args, labels)
output = output.getvalue().strip()
assert output == '2007: \x1b[91m▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇\x1b[0m 183.32\n2008: \x1b[91m▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇\x1b[0m 231.23\n2009: \x1b[91m▇\x1b[0m 16.43\n2010: \x1b[91m▇▇▇▇\x1b[0m 50.21\n2011: \x1b[91m▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇\x1b[0m 508.97\n2012: \x1b[91m▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇\x1b[0m 212.05\n2014: \x1b[91m▇▇\x1b[0m 30.00'