OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 unittest | 5 from testing_support import auto_stub |
6 | |
7 | 6 |
8 from testing_support.git.repo import GitRepo | 7 from testing_support.git.repo import GitRepo |
9 from testing_support.git.schema import GitRepoSchema | 8 from testing_support.git.schema import GitRepoSchema |
10 | 9 |
11 | 10 |
12 class GitRepoSchemaTestBase(unittest.TestCase): | 11 class GitRepoSchemaTestBase(auto_stub.TestCase): |
13 """A TestCase with a built-in GitRepoSchema. | 12 """A TestCase with a built-in GitRepoSchema. |
14 | 13 |
15 Expects a class variable REPO_SCHEMA to be a GitRepoSchema string in the form | 14 Expects a class variable REPO_SCHEMA to be a GitRepoSchema string in the form |
16 described by that class. | 15 described by that class. |
17 | 16 |
18 You may also set class variables in the form COMMIT_%(commit_name)s, which | 17 You may also set class variables in the form COMMIT_%(commit_name)s, which |
19 provide the content for the given commit_name commits. | 18 provide the content for the given commit_name commits. |
20 | 19 |
21 You probably will end up using either GitRepoReadOnlyTestBase or | 20 You probably will end up using either GitRepoReadOnlyTestBase or |
22 GitRepoReadWriteTestBase for real tests. | 21 GitRepoReadWriteTestBase for real tests. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 self.repo = GitRepo(self.r_schema) | 71 self.repo = GitRepo(self.r_schema) |
73 | 72 |
74 def tearDown(self): | 73 def tearDown(self): |
75 self.repo.nuke() | 74 self.repo.nuke() |
76 super(GitRepoReadWriteTestBase, self).tearDown() | 75 super(GitRepoReadWriteTestBase, self).tearDown() |
77 | 76 |
78 def assertSchema(self, schema_string): | 77 def assertSchema(self, schema_string): |
79 self.assertEqual(GitRepoSchema(schema_string).simple_graph(), | 78 self.assertEqual(GitRepoSchema(schema_string).simple_graph(), |
80 self.repo.to_schema().simple_graph()) | 79 self.repo.to_schema().simple_graph()) |
81 | 80 |
OLD | NEW |