| 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 | |
| 13 | |
| 14 def main(): | |
| 15 expected = sorted([ | |
| 16 'check_files.py', | |
| 17 'file1.txt', | |
| 18 'file1_copy.txt', | |
| 19 'file2.txt', | |
| 20 'repeated_files.py', | |
| 21 ]) | |
| 22 actual = sorted(os.listdir(ROOT_DIR)) | |
| 23 if expected != actual: | |
| 24 print >> sys.stderr, 'Expected list doesn\'t match:' | |
| 25 print >> sys.stderr, ', '.join(expected) | |
| 26 print >> sys.stderr, ', '.join(actual) | |
| 27 return 1 | |
| 28 | |
| 29 # Check that file2.txt is in reality file3.txt. | |
| 30 with open(os.path.join(ROOT_DIR, 'file2.txt'), 'rb') as f: | |
| 31 if f.read() != 'File3\n': | |
| 32 print >> sys.stderr, 'file2.txt should be file3.txt in reality' | |
| 33 return 2 | |
| 34 | |
| 35 print 'Success' | |
| 36 return 0 | |
| 37 | |
| 38 | |
| 39 if __name__ == '__main__': | |
| 40 sys.exit(main()) | |
| OLD | NEW |