aboutsummaryrefslogtreecommitdiff
path: root/pipeline/combine_results_test.py
blob: 84c4cb762398b74ab861e3da54b704ce034c75a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python -S
"""
combine_results_test.py: Tests for combine_results.py
"""

import csv
import cStringIO
import unittest

import combine_results  # module under test


# TODO: Make these test more the header row.  They rely heavily on the file
# system!

class CombineResultsTest(unittest.TestCase):

  def testCombineDistResults(self):
    stdin = cStringIO.StringIO('')
    out = cStringIO.StringIO()
    c_out = csv.writer(out)

    combine_results.CombineDistResults(stdin, c_out, 10)
    actual = out.getvalue()
    self.assert_(actual.startswith('date'), actual)

  def testCombineAssocResults(self):
    stdin = cStringIO.StringIO('')
    out = cStringIO.StringIO()
    c_out = csv.writer(out)

    combine_results.CombineAssocResults(stdin, c_out, 10)
    actual = out.getvalue()
    self.assert_(actual.startswith('dummy'), actual)


if __name__ == '__main__':
  unittest.main()