| Index: tests/gcl_unittest.py
|
| diff --git a/tests/gcl_unittest.py b/tests/gcl_unittest.py
|
| index e939246902c55adcc34e808dcf91777b52ca5f31..c160aa178dd81277f0799ec315a65a635f29a4a0 100755
|
| --- a/tests/gcl_unittest.py
|
| +++ b/tests/gcl_unittest.py
|
| @@ -28,6 +28,9 @@ class GclTestsBase(SuperMoxTestBase):
|
|
|
| class GclUnittest(GclTestsBase):
|
| """General gcl.py tests."""
|
| + def tearDown(self):
|
| + gcl.CODEREVIEW_SETTINGS = {}
|
| +
|
| def testMembersChanged(self):
|
| self.mox.ReplayAll()
|
| members = [
|
| @@ -73,6 +76,39 @@ class GclUnittest(GclTestsBase):
|
| # TODO(maruel): TEST ME
|
| pass
|
|
|
| + def testDefaultSettings(self):
|
| + self.assertEquals({}, gcl.CODEREVIEW_SETTINGS)
|
| +
|
| + def testGetCodeReviewSettingOk(self):
|
| + self.mox.StubOutWithMock(gcl, 'GetCachedFile')
|
| + gcl.GetCachedFile(gcl.CODEREVIEW_SETTINGS_FILE).AndReturn(
|
| + 'foo:bar\n'
|
| + '# comment\n'
|
| + ' c : d \n\r'
|
| + 'e: f')
|
| + self.mox.ReplayAll()
|
| + self.assertEquals('bar', gcl.GetCodeReviewSetting('foo'))
|
| + self.assertEquals('d', gcl.GetCodeReviewSetting('c'))
|
| + self.assertEquals('f', gcl.GetCodeReviewSetting('e'))
|
| + self.assertEquals('', gcl.GetCodeReviewSetting('other'))
|
| + self.assertEquals(
|
| + {'foo': 'bar', 'c': 'd', 'e': 'f', '__just_initialized': None},
|
| + gcl.CODEREVIEW_SETTINGS)
|
| +
|
| + def testGetCodeReviewSettingFail(self):
|
| + self.mox.StubOutWithMock(gcl, 'GetCachedFile')
|
| + gcl.GetCachedFile(gcl.CODEREVIEW_SETTINGS_FILE).AndReturn(
|
| + 'aaa\n'
|
| + ' c : d \n\r'
|
| + 'e: f')
|
| + self.mox.ReplayAll()
|
| + try:
|
| + gcl.GetCodeReviewSetting('c')
|
| + self.fail()
|
| + except gcl.gclient_utils.Error:
|
| + pass
|
| + self.assertEquals({}, gcl.CODEREVIEW_SETTINGS)
|
| +
|
| def testGetRepositoryRootNone(self):
|
| gcl.os.getcwd().AndReturn(self.fake_root_dir)
|
| gcl.SVN.GetCheckoutRoot(self.fake_root_dir).AndReturn(None)
|
|
|