OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import atexit | 5 import atexit |
6 import collections | 6 import collections |
7 import copy | 7 import copy |
8 import datetime | 8 import datetime |
9 import hashlib | 9 import hashlib |
10 import os | 10 import os |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 class GitRepo(object): | 233 class GitRepo(object): |
234 """Creates a real git repo for a GitRepoSchema. | 234 """Creates a real git repo for a GitRepoSchema. |
235 | 235 |
236 Obtains schema and content information from the GitRepoSchema. | 236 Obtains schema and content information from the GitRepoSchema. |
237 | 237 |
238 The format for the commit data supplied by GitRepoSchema.data_for is: | 238 The format for the commit data supplied by GitRepoSchema.data_for is: |
239 { | 239 { |
240 SPECIAL_KEY: special_value, | 240 SPECIAL_KEY: special_value, |
241 ... | 241 ... |
242 "path/to/some/file": { 'data': "some data content for this file", | 242 "path/to/some/file": { 'data': "some data content for this file", |
243 'mode': 0755 }, | 243 'mode': 0o0755 }, |
244 ... | 244 ... |
245 } | 245 } |
246 | 246 |
247 The SPECIAL_KEYs are the following attribues of the GitRepo class: | 247 The SPECIAL_KEYs are the following attribues of the GitRepo class: |
248 * AUTHOR_NAME | 248 * AUTHOR_NAME |
249 * AUTHOR_EMAIL | 249 * AUTHOR_EMAIL |
250 * AUTHOR_DATE - must be a datetime.datetime instance | 250 * AUTHOR_DATE - must be a datetime.datetime instance |
251 * COMMITTER_NAME | 251 * COMMITTER_NAME |
252 * COMMITTER_EMAIL | 252 * COMMITTER_EMAIL |
253 * COMMITTER_DATE - must be a datetime.datetime instance | 253 * COMMITTER_DATE - must be a datetime.datetime instance |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 super(GitRepoReadWriteTestBase, self).setUp() | 520 super(GitRepoReadWriteTestBase, self).setUp() |
521 self.repo = self.r_schema.reify() | 521 self.repo = self.r_schema.reify() |
522 | 522 |
523 def tearDown(self): | 523 def tearDown(self): |
524 self.repo.nuke() | 524 self.repo.nuke() |
525 super(GitRepoReadWriteTestBase, self).tearDown() | 525 super(GitRepoReadWriteTestBase, self).tearDown() |
526 | 526 |
527 def assertSchema(self, schema_string): | 527 def assertSchema(self, schema_string): |
528 self.assertEqual(GitRepoSchema(schema_string).simple_graph(), | 528 self.assertEqual(GitRepoSchema(schema_string).simple_graph(), |
529 self.repo.to_schema().simple_graph()) | 529 self.repo.to_schema().simple_graph()) |
OLD | NEW |