OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
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 | |
4 # found in the LICENSE file. | |
5 | |
6 """Checks all the expected files are mapped.""" | |
7 | |
8 import os | |
9 import sys | |
10 | |
11 ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) | |
12 | |
cmp
2012/08/28 17:49:30
insert an empty line here (i think!)
M-A Ruel
2012/08/28 21:59:36
done, but I had to update the sha-1 in the manifes
| |
13 def main(): | |
14 expected = sorted([ | |
15 'check_files.py', | |
16 'gtest_fake.py', | |
17 'file1.txt', | |
18 'file2.txt', | |
19 ]) | |
20 actual = sorted(os.listdir(ROOT_DIR)) | |
21 if expected != actual: | |
22 print >> sys.stderr, 'Expected list doesn\'t match:' | |
23 print >> sys.stderr, ', '.join(expected) | |
24 print >> sys.stderr, ', '.join(actual) | |
25 return 1 | |
26 | |
27 # Check that file2.txt is in reality file3.txt. | |
28 with open(os.path.join(ROOT_DIR, 'file2.txt'), 'rb') as f: | |
29 if f.read() != 'File3\n': | |
30 print >> sys.stderr, 'file2.txt should be file3.txt in reality' | |
31 return 2 | |
32 | |
33 print 'Success' | |
34 return 0 | |
35 | |
36 | |
37 if __name__ == '__main__': | |
38 sys.exit(main()) | |
OLD | NEW |