Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: testing_support/git/unittest_helpers.py

Issue 424223002: Add auto_stub mocking library. (Closed) Base URL: https://chromium.googlesource.com/infra/testing/testing_support@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing_support/auto_stub.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « testing_support/auto_stub.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698