OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """Check that filter_data_for_size seems to work.""" |
| 7 |
| 8 import cStringIO |
| 9 import unittest |
| 10 |
| 11 import filter_data_for_size |
| 12 |
| 13 |
| 14 class FilterTest(unittest.TestCase): |
| 15 |
| 16 def testFixWordTxt(self): |
| 17 test_input = cStringIO.StringIO("$ALetter-$dictionaryCJK") |
| 18 test_output = cStringIO.StringIO() |
| 19 filter_data_for_size._process_word_txt(test_input, test_output) |
| 20 self.assertEqual(test_output.getvalue(), "$ALetter") |
| 21 |
| 22 def testPrintBlock(self): |
| 23 test_data = """\ |
| 24 foo{aaa} |
| 25 """ |
| 26 test_input = cStringIO.StringIO(test_data) |
| 27 test_output = cStringIO.StringIO() |
| 28 line = test_input.next() |
| 29 filter_data_for_size._print_block(line, test_input, test_output) |
| 30 self.assertEqual(test_output.getvalue(), test_data) |
| 31 |
| 32 if __name__ == '__main__': |
| 33 unittest.main() |
OLD | NEW |