Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: native_client_sdk/src/tools/tests/create_html_test.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « native_client_sdk/src/tools/tests/chrome_mock.py ('k') | native_client_sdk/src/tools/tests/fix_deps_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698