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 optparse | 6 import optparse |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 def testOptionalFiles(self): | 381 def testOptionalFiles(self): |
382 files_cfg = CreateTestFilesCfg(self.temp_dir) | 382 files_cfg = CreateTestFilesCfg(self.temp_dir) |
383 optional_fn = 'allany_dev_optional.txt' | 383 optional_fn = 'allany_dev_optional.txt' |
384 arch = '64bit' | 384 arch = '64bit' |
385 buildtype = 'dev' | 385 buildtype = 'dev' |
386 fparser = archive_utils.FilesCfgParser(files_cfg, buildtype, arch) | 386 fparser = archive_utils.FilesCfgParser(files_cfg, buildtype, arch) |
387 self.assertTrue(fparser.IsOptional(optional_fn)) | 387 self.assertTrue(fparser.IsOptional(optional_fn)) |
388 non_existent_fn = 'non_existent_fn.txt' | 388 non_existent_fn = 'non_existent_fn.txt' |
389 self.assertFalse(fparser.IsOptional(non_existent_fn)) | 389 self.assertFalse(fparser.IsOptional(non_existent_fn)) |
| 390 not_optional_fn = 'archive_allany.txt' |
| 391 self.assertFalse(fparser.IsOptional(not_optional_fn)) |
390 | 392 |
391 # It's only optional for 'dev' builds. | 393 # It's only optional for 'dev' builds. |
392 buildtype = 'official' | 394 buildtype = 'official' |
393 fparser = archive_utils.FilesCfgParser(files_cfg, buildtype, arch) | 395 fparser = archive_utils.FilesCfgParser(files_cfg, buildtype, arch) |
394 self.assertFalse(fparser.IsOptional(optional_fn)) | 396 self.assertFalse(fparser.IsOptional(optional_fn)) |
395 | 397 |
396 def testDirectArchive(self): | 398 def testDirectArchive(self): |
397 files_cfg = CreateTestFilesCfg(self.temp_dir) | 399 files_cfg = CreateTestFilesCfg(self.temp_dir) |
398 arch = '64bit' | 400 arch = '64bit' |
399 buildtype = 'dev' | 401 buildtype = 'dev' |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | 635 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) |
634 svn_client = pysvn.Client() | 636 svn_client = pysvn.Client() |
635 DiffFilesCfg(RealFilesCfgTest.WIN_PATH, svn_client) | 637 DiffFilesCfg(RealFilesCfgTest.WIN_PATH, svn_client) |
636 DiffFilesCfg(RealFilesCfgTest.LINUX_PATH, svn_client) | 638 DiffFilesCfg(RealFilesCfgTest.LINUX_PATH, svn_client) |
637 DiffFilesCfg(RealFilesCfgTest.MAC_PATH, svn_client) | 639 DiffFilesCfg(RealFilesCfgTest.MAC_PATH, svn_client) |
638 DiffFilesCfg(RealFilesCfgTest.CROS_PATH, svn_client) | 640 DiffFilesCfg(RealFilesCfgTest.CROS_PATH, svn_client) |
639 | 641 |
640 # Specify error return so caller (e.g. shell script) can easily detect | 642 # Specify error return so caller (e.g. shell script) can easily detect |
641 # failures. | 643 # failures. |
642 sys.exit(errors) | 644 sys.exit(errors) |
OLD | NEW |