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

Side by Side Diff: native_client_sdk/src/tools/zip_test.py

Issue 11428111: [NaCl SDK] Fix zip_test failure on mac buildbots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added correct ZipInfo Created 8 years 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 oshelpers 7 import oshelpers
8 import shutil 8 import shutil
9 import subprocess 9 import subprocess
10 import sys 10 import sys
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 self.MakeFile('file2', 3354) 97 self.MakeFile('file2', 3354)
98 self.RunZip([self.zipname, 'file*']) 98 self.RunZip([self.zipname, 'file*'])
99 self.OpenZipFile() 99 self.OpenZipFile()
100 self.assertEqual(len(self.zipfile.namelist()), 2) 100 self.assertEqual(len(self.zipfile.namelist()), 2)
101 101
102 def testAddDir(self): 102 def testAddDir(self):
103 os.mkdir(self.GetTempPath('dir1')) 103 os.mkdir(self.GetTempPath('dir1'))
104 self.RunZip([self.zipname, 'dir1']) 104 self.RunZip([self.zipname, 'dir1'])
105 self.OpenZipFile() 105 self.OpenZipFile()
106 self.assertEqual(len(self.zipfile.namelist()), 1) 106 self.assertEqual(len(self.zipfile.namelist()), 1)
107 self.assertRaises(KeyError, self.zipfile.getinfo, 'dir1')
108 self.zipfile.getinfo('dir1/')
107 109
108 def testAddRecursive(self): 110 def testAddRecursive(self):
109 os.mkdir(self.GetTempPath('dir1')) 111 os.mkdir(self.GetTempPath('dir1'))
110 self.MakeFile(os.path.join('dir1', 'file1'), 256) 112 self.MakeFile(os.path.join('dir1', 'file1'), 256)
111 os.mkdir(self.GetTempPath(os.path.join('dir1', 'dir2'))) 113 os.mkdir(self.GetTempPath(os.path.join('dir1', 'dir2')))
112 self.MakeFile(os.path.join('dir1', 'dir2', 'file2'), 1234) 114 self.MakeFile(os.path.join('dir1', 'dir2', 'file2'), 1234)
113 self.RunZip([self.zipname, '-r', 'dir1']) 115 self.RunZip([self.zipname, '-r', 'dir1'])
114 self.OpenZipFile() 116 self.OpenZipFile()
115 self.assertEqual(len(self.zipfile.namelist()), 4) 117 self.assertEqual(len(self.zipfile.namelist()), 4)
116 118
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 self.CloseZipFile() 177 self.CloseZipFile()
176 178
177 file3 = self.MakeFile('file3', 768) 179 file3 = self.MakeFile('file3', 768)
178 self.RunZip([self.zipname, file3]) 180 self.RunZip([self.zipname, file3])
179 self.OpenZipFile() 181 self.OpenZipFile()
180 self.assertEqual(len(self.zipfile.namelist()), 3) 182 self.assertEqual(len(self.zipfile.namelist()), 3)
181 183
182 184
183 if __name__ == '__main__': 185 if __name__ == '__main__':
184 unittest.main() 186 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