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

Side by Side Diff: native_client_sdk/src/tools/tests/fix_deps_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) 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 import os 5 import os
6 import sys 6 import sys
7 import tempfile 7 import tempfile
8 import unittest 8 import unittest
9 9
10 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) 10 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
11 PARENT_DIR = os.path.dirname(SCRIPT_DIR) 11 PARENT_DIR = os.path.dirname(SCRIPT_DIR)
12 DATA_DIR = os.path.join(SCRIPT_DIR, 'data') 12 DATA_DIR = os.path.join(SCRIPT_DIR, 'data')
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 # For the mock library 16 # For the mock library
17 sys.path.append(MOCK_DIR) 17 sys.path.append(MOCK_DIR)
18 sys.path.append(PARENT_DIR) 18 sys.path.append(PARENT_DIR)
19 19
20 import fix_deps 20 import fix_deps
21 import mock 21 import mock
22 22
23 23
24 class TestFixDeps(unittest.TestCase): 24 class TestFixDeps(unittest.TestCase):
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 def testDoubleInvoke(self): 80 def testDoubleInvoke(self):
81 self.tempfile = tempfile.mktemp("_sdktest") 81 self.tempfile = tempfile.mktemp("_sdktest")
82 with open(self.tempfile, 'w') as out: 82 with open(self.tempfile, 'w') as out:
83 out.write('foo.o: foo\\ bar.h\n') 83 out.write('foo.o: foo\\ bar.h\n')
84 fix_deps.FixupDepFile(self.tempfile) 84 fix_deps.FixupDepFile(self.tempfile)
85 self.assertRaises(fix_deps.Error, fix_deps.FixupDepFile, self.tempfile) 85 self.assertRaises(fix_deps.Error, fix_deps.FixupDepFile, self.tempfile)
86 86
87 87
88 if __name__ == '__main__': 88 if __name__ == '__main__':
89 unittest.main() 89 unittest.main()
OLDNEW
« no previous file with comments | « native_client_sdk/src/tools/tests/create_html_test.py ('k') | native_client_sdk/src/tools/tests/getos_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698