OLD | NEW |
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 sys | 7 import sys |
8 import re | 8 import re |
9 import tarfile | 9 import tarfile |
10 import tempfile | 10 import tempfile |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 # Now update using --force. | 215 # Now update using --force. |
216 output = self._Run(['update', 'pepper_23', '--force']) | 216 output = self._Run(['update', 'pepper_23', '--force']) |
217 self.assertTrue('Updating bundle' in output) | 217 self.assertTrue('Updating bundle' in output) |
218 | 218 |
219 def testUpdateUnknownBundles(self): | 219 def testUpdateUnknownBundles(self): |
220 """The update command should ignore unknown bundles and notify the user.""" | 220 """The update command should ignore unknown bundles and notify the user.""" |
221 self._WriteManifest() | 221 self._WriteManifest() |
222 output = self._Run(['update', 'foobar']) | 222 output = self._Run(['update', 'foobar']) |
223 self.assertTrue('unknown bundle' in output) | 223 self.assertTrue('unknown bundle' in output) |
224 | 224 |
| 225 def testUpdateRecommended(self): |
| 226 """The update command should update only recommended bundles when run |
| 227 without args. |
| 228 """ |
| 229 bundle = self._AddDummyBundle(self.manifest, 'pepper_26') |
| 230 bundle.recommended = 'yes' |
| 231 self._WriteManifest() |
| 232 output = self._Run(['update']) |
| 233 self.assertTrue(os.path.exists( |
| 234 os.path.join(self.basedir, 'nacl_sdk', 'pepper_26', 'dummy.txt'))) |
| 235 |
| 236 def testUpdateCanary(self): |
| 237 """The update command should create the correct directory name for repath'd |
| 238 bundles. |
| 239 """ |
| 240 bundle = self._AddDummyBundle(self.manifest, 'pepper_26') |
| 241 bundle.name = 'pepper_canary' |
| 242 self._WriteManifest() |
| 243 output = self._Run(['update']) |
| 244 self.assertTrue(os.path.exists( |
| 245 os.path.join(self.basedir, 'nacl_sdk', 'pepper_canary', 'dummy.txt'))) |
| 246 |
225 | 247 |
226 if __name__ == '__main__': | 248 if __name__ == '__main__': |
227 sys.exit(unittest.main()) | 249 unittest.main() |
OLD | NEW |