OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 import os | 5 import os |
6 import unittest | 6 import unittest |
7 import shutil | 7 import shutil |
8 import sys | 8 import sys |
9 import tempfile | 9 import tempfile |
10 | 10 |
11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
12 PARENT_DIR = os.path.dirname(SCRIPT_DIR) | 12 PARENT_DIR = os.path.dirname(SCRIPT_DIR) |
13 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) | 13 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) |
14 MOCK_DIR = os.path.join(CHROME_SRC, "third_party", "pymock") | 14 MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock') |
15 | 15 |
16 sys.path.append(PARENT_DIR) | 16 sys.path.append(PARENT_DIR) |
17 sys.path.append(MOCK_DIR) | 17 sys.path.append(MOCK_DIR) |
18 | 18 |
19 import create_html | 19 import create_html |
20 import mock | 20 import mock |
21 | 21 |
22 class TestCreateHtml(unittest.TestCase): | 22 class TestCreateHtml(unittest.TestCase): |
23 def setUp(self): | 23 def setUp(self): |
24 self.tempdir = None | 24 self.tempdir = None |
(...skipping 22 matching lines...) Expand all Loading... |
47 create_html.CreateHTML([nmf_file], options) | 47 create_html.CreateHTML([nmf_file], options) |
48 # Assert that the file was created | 48 # Assert that the file was created |
49 self.assertTrue(os.path.exists(expected_html)) | 49 self.assertTrue(os.path.exists(expected_html)) |
50 # Assert that nothing else was created | 50 # Assert that nothing else was created |
51 self.assertEqual(os.listdir(self.tempdir), | 51 self.assertEqual(os.listdir(self.tempdir), |
52 [os.path.basename(expected_html)]) | 52 [os.path.basename(expected_html)]) |
53 | 53 |
54 | 54 |
55 if __name__ == '__main__': | 55 if __name__ == '__main__': |
56 unittest.main() | 56 unittest.main() |
OLD | NEW |