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 json | 6 import json |
7 import logging | 7 import logging |
8 import sys | 8 import sys |
9 import unittest | 9 import unittest |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 u'a': { | 23 u'a': { |
24 u'link': u'somewhere', | 24 u'link': u'somewhere', |
25 u'mode': 123, | 25 u'mode': 123, |
26 u'timestamp': 456, | 26 u'timestamp': 456, |
27 }, | 27 }, |
28 u'b': { | 28 u'b': { |
29 u'mode': 123, | 29 u'mode': 123, |
30 u'sha-1': u'0123456789abcdef0123456789abcdef01234567' | 30 u'sha-1': u'0123456789abcdef0123456789abcdef01234567' |
31 } | 31 } |
32 }, | 32 }, |
| 33 u'includes': [u'0123456789abcdef0123456789abcdef01234567'], |
33 u'read_only': False, | 34 u'read_only': False, |
34 u'relative_cwd': u'somewhere_else' | 35 u'relative_cwd': u'somewhere_else' |
35 } | 36 } |
36 m = run_test_from_archive.load_manifest(json.dumps(data)) | 37 m = run_test_from_archive.load_manifest(json.dumps(data)) |
37 self.assertEquals(data, m) | 38 self.assertEquals(data, m) |
38 | 39 |
39 def test_load_manifest_bad(self): | 40 def test_load_manifest_bad(self): |
40 data = { | 41 data = { |
41 u'files': { | 42 u'files': { |
42 u'a': { | 43 u'a': { |
43 u'link': u'somewhere', | 44 u'link': u'somewhere', |
44 u'sha-1': u'0123456789abcdef0123456789abcdef01234567' | 45 u'sha-1': u'0123456789abcdef0123456789abcdef01234567' |
45 } | 46 } |
46 }, | 47 }, |
47 } | 48 } |
48 try: | 49 try: |
49 run_test_from_archive.load_manifest(json.dumps(data)) | 50 run_test_from_archive.load_manifest(json.dumps(data)) |
50 self.fail() | 51 self.fail() |
51 except run_test_from_archive.ConfigError: | 52 except run_test_from_archive.ConfigError: |
52 pass | 53 pass |
53 | 54 |
54 | 55 |
55 | 56 |
56 if __name__ == '__main__': | 57 if __name__ == '__main__': |
57 logging.basicConfig( | 58 logging.basicConfig( |
58 level=(logging.DEBUG if '-v' in sys.argv else logging.ERROR)) | 59 level=(logging.DEBUG if '-v' in sys.argv else logging.ERROR)) |
59 unittest.main() | 60 unittest.main() |
OLD | NEW |