コード例 #1
0
 def test_ascii_graph_truncated_when_truncating_one_side(self):
     result = ti.ascii_graph_truncated(LongIntTable({1: 1, 2: 1, 3: 8000}))
     expected = ('3:{}\neach x represents 100.0 occurences\nnot included: 1-2'
                 .format(80 * 'x'))
     self.assertEqual(result, expected)
コード例 #2
0
 def test_ascii_graph_truncated_when_truncating_two_sides(self):
     result = ti.ascii_graph_truncated(LongIntTable({1: 1, 2: 1, 3: 8000, 4: 1}))
     expected = ('3:{}\n'.format(80 * 'x') +
                 'each x represents 100.0 occurences\n' +
                 'not included: 1-2 and 4')
     self.assertEqual(result, expected)
コード例 #3
0
 def test_ascii_graph_truncated_when_no_truncating(self):
     result = ti.ascii_graph_truncated(LongIntTable({1: 1, 2: 1}))
     expected = '1:x\n2:x\neach x represents 1 occurence'
     self.assertEqual(result, expected)