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

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

Issue 16022005: [NaCl SDK] Add keyboard interrupt handlers for python scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « native_client_sdk/src/tools/oshelpers.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5
6 import os 6 import os
7 import shutil 7 import shutil
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 import tempfile 10 import tempfile
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 def OpenZipFile(self): 75 def OpenZipFile(self):
76 self.zipfile = zipfile.ZipFile(self.GetTempPath(self.zipname), 'r') 76 self.zipfile = zipfile.ZipFile(self.GetTempPath(self.zipname), 'r')
77 77
78 def CloseZipFile(self): 78 def CloseZipFile(self):
79 self.zipfile.close() 79 self.zipfile.close()
80 self.zipfile = None 80 self.zipfile = None
81 81
82 def GetZipInfo(self, path): 82 def GetZipInfo(self, path):
83 return self.zipfile.getinfo(oshelpers.OSMakeZipPath(path)) 83 return self.zipfile.getinfo(oshelpers.OSMakeZipPath(path))
84 84
85
86 def testNothingToDo(self): 85 def testNothingToDo(self):
87 self.assertRaises(subprocess.CalledProcessError, self.RunZip, 86 self.assertRaises(subprocess.CalledProcessError, self.RunZip,
88 self.zipname, 'nonexistent_file') 87 self.zipname, 'nonexistent_file')
89 self.assertFalse(os.path.exists(self.zipname)) 88 self.assertFalse(os.path.exists(self.zipname))
90 89
91 def testAddSomeFiles(self): 90 def testAddSomeFiles(self):
92 file1 = self.MakeFile('file1', 1024) 91 file1 = self.MakeFile('file1', 1024)
93 file2 = self.MakeFile('file2', 3354) 92 file2 = self.MakeFile('file2', 3354)
94 self.RunZip(self.zipname, file1, file2) 93 self.RunZip(self.zipname, file1, file2)
95 self.OpenZipFile() 94 self.OpenZipFile()
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 bin_cp = self.MakeExecutableFile('bin', 'cp') 247 bin_cp = self.MakeExecutableFile('bin', 'cp')
249 cp = os.path.basename(bin_cp) 248 cp = os.path.basename(bin_cp)
250 249
251 # Note, "bin" not added to PATH. 250 # Note, "bin" not added to PATH.
252 output, _ = self.RunWhich(bin_cp) 251 output, _ = self.RunWhich(bin_cp)
253 self.assertTrue(os.path.join('bin', cp) in output) 252 self.assertTrue(os.path.join('bin', cp) in output)
254 253
255 254
256 if __name__ == '__main__': 255 if __name__ == '__main__':
257 unittest.main() 256 unittest.main()
OLDNEW
« no previous file with comments | « native_client_sdk/src/tools/oshelpers.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698