68
|
1 #!/usr/bin/env python
|
|
2 # -*- coding: utf-8 -*-
|
|
3
|
|
4 """
|
|
5 unit tests for histograms
|
|
6 """
|
|
7
|
|
8 import os
|
|
9 import sys
|
|
10 import unittest
|
|
11 from numerics.histogram import Histogram
|
|
12
|
|
13 # globals
|
|
14 here = os.path.dirname(os.path.abspath(__file__))
|
|
15
|
|
16 class HistogramUnitTest(unittest.TestCase):
|
|
17
|
|
18 def test_histogram(self):
|
|
19 """basic histogram test"""
|
|
20
|
|
21 # make some test data
|
|
22 data = [0,0,1,1,2,3,4,5,6,7,8,8,8]
|
|
23 bins = range(0,10)
|
|
24
|
|
25 # make a histogram
|
|
26 h = Histogram(bins)
|
|
27
|
|
28 if __name__ == '__main__':
|
|
29 unittest.main()
|
|
30
|