OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import json | 6 import json |
7 import os | 7 import os |
8 import unittest | 8 import unittest |
9 | 9 |
10 from handlebar_dict_generator import HandlebarDictGenerator | 10 from handlebar_dict_generator import HandlebarDictGenerator |
(...skipping 20 matching lines...) Expand all Loading... |
31 self._GenerateTest('test_file.json') | 31 self._GenerateTest('test_file.json') |
32 | 32 |
33 def testGetLinkToRefType(self): | 33 def testGetLinkToRefType(self): |
34 link = _GetLinkToRefType('truthTeller', 'liar.Tab') | 34 link = _GetLinkToRefType('truthTeller', 'liar.Tab') |
35 self.assertEquals(link['href'], 'liar.html#type-Tab') | 35 self.assertEquals(link['href'], 'liar.html#type-Tab') |
36 self.assertEquals(link['text'], 'Tab') | 36 self.assertEquals(link['text'], 'Tab') |
37 link = _GetLinkToRefType('truthTeller', 'Tab') | 37 link = _GetLinkToRefType('truthTeller', 'Tab') |
38 self.assertEquals(link['href'], 'truthTeller.html#type-Tab') | 38 self.assertEquals(link['href'], 'truthTeller.html#type-Tab') |
39 self.assertEquals(link['text'], 'Tab') | 39 self.assertEquals(link['text'], 'Tab') |
40 link = _GetLinkToRefType('nay', 'lies.chrome.bookmarks.Tab') | 40 link = _GetLinkToRefType('nay', 'lies.chrome.bookmarks.Tab') |
41 self.assertEquals(link['href'], 'lies.html#type-chrome.bookmarks.Tab') | 41 self.assertEquals(link['href'], 'lies.chrome.bookmarks.html#type-Tab') |
42 self.assertEquals(link['text'], 'chrome.bookmarks.Tab') | 42 self.assertEquals(link['text'], 'Tab') |
43 | 43 |
44 def testFormatValue(self): | 44 def testFormatValue(self): |
45 self.assertEquals('1,234,567', _FormatValue(1234567)) | 45 self.assertEquals('1,234,567', _FormatValue(1234567)) |
46 self.assertEquals('67', _FormatValue(67)) | 46 self.assertEquals('67', _FormatValue(67)) |
47 self.assertEquals('234,567', _FormatValue(234567)) | 47 self.assertEquals('234,567', _FormatValue(234567)) |
48 | 48 |
49 if __name__ == '__main__': | 49 if __name__ == '__main__': |
50 unittest.main() | 50 unittest.main() |
OLD | NEW |