Chromium Code Reviews| Index: infra/libs/git2/test/config_ref_test.py |
| diff --git a/infra/services/gnumbd/test/config_test.py b/infra/libs/git2/test/config_ref_test.py |
| similarity index 80% |
| rename from infra/services/gnumbd/test/config_test.py |
| rename to infra/libs/git2/test/config_ref_test.py |
| index 7538c95939bf3f6d945f483ee5a3f6f7966fbe1f..5d188ae6c1c9bafba91ea3018bd0a66020b1019d 100644 |
| --- a/infra/services/gnumbd/test/config_test.py |
| +++ b/infra/libs/git2/test/config_ref_test.py |
| @@ -2,10 +2,13 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| -from infra.services.gnumbd.support import config_ref, git |
| -from infra.services.gnumbd.test import git_test |
| +from infra.libs import git2 |
|
agable
2014/06/27 18:53:12
nit: no newlines
I thought our policy was:
* buil
|
| -class TestConfigRef(git_test.TestBasis): |
| +from infra.libs.git2 import config_ref |
| + |
| +from infra.libs.git2.test import git2_test |
| + |
|
agable
2014/06/27 18:53:12
nit: two newlines
Also I'm not gonna comment on e
|
| +class TestConfigRef(git2_test.TestBasis): |
| def writeConfig(self, config_data): |
| ref = 'refs/metaconfig' |
| def inner(): |
| @@ -24,14 +27,14 @@ class TestConfigRef(git_test.TestBasis): |
| def testNonExist(self): |
| r = self.mkRepo() |
| - c = config_ref.ConfigRef(git.Ref(r, 'refs/metaconfig')) |
| + c = config_ref.ConfigRef(git2.Ref(r, 'refs/metaconfig')) |
| self.assertEqual(c.current, c.DEFAULTS) |
| self.assertEqual(c['interval'], c.DEFAULTS['interval']) |
| def testExistsBad(self): |
| self.writeConfig("not valid config") |
| r = self.mkRepo() |
| - c = config_ref.ConfigRef(git.Ref(r, 'refs/metaconfig')) |
| + c = config_ref.ConfigRef(git2.Ref(r, 'refs/metaconfig')) |
| c.evaluate() |
| self.assertEqual(c.current, c.DEFAULTS) |
| @@ -43,7 +46,7 @@ class TestConfigRef(git_test.TestBasis): |
| def testExistsGood(self): |
| self.writeConfig('{"interval": 100}') |
| r = self.mkRepo() |
| - c = config_ref.ConfigRef(git.Ref(r, 'refs/metaconfig')) |
| + c = config_ref.ConfigRef(git2.Ref(r, 'refs/metaconfig')) |
| self.assertAlmostEqual(c['interval'], 100.0) |
| self.writeConfig('{"interval": "cat"}') |