summaryrefslogtreecommitdiffstats
path: root/tests/test_git_config.py
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2012-11-14 11:36:51 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2012-11-14 11:38:57 +0900
commitc1b86a232383748811c6faf17f364e63e10f7dd4 (patch)
tree8f28c8e8a922ffd4165f48a1988500070936bd39 /tests/test_git_config.py
parent98ffba1401056e2d88d3f3898b6fbf5d7d3931a4 (diff)
downloadgit-repo-c1b86a232383748811c6faf17f364e63e10f7dd4.tar.gz
Fix inconsistent indentation
The repo coding style is to indent at 2 characters, but there are many places where this is not followed. Enable pylint warning "W0311: Bad indentation" and make sure all indentation is at multiples of 2 characters. Change-Id: I68f0f64470789ce2429ab11104d15d380a63e6a8
Diffstat (limited to 'tests/test_git_config.py')
-rw-r--r--tests/test_git_config.py82
1 files changed, 41 insertions, 41 deletions
diff --git a/tests/test_git_config.py b/tests/test_git_config.py
index 5b1770e7..3d4b9970 100644
--- a/tests/test_git_config.py
+++ b/tests/test_git_config.py
@@ -4,49 +4,49 @@ import unittest
4import git_config 4import git_config
5 5
6def fixture(*paths): 6def fixture(*paths):
7 """Return a path relative to test/fixtures. 7 """Return a path relative to test/fixtures.
8 """ 8 """
9 return os.path.join(os.path.dirname(__file__), 'fixtures', *paths) 9 return os.path.join(os.path.dirname(__file__), 'fixtures', *paths)
10 10
11class GitConfigUnitTest(unittest.TestCase): 11class GitConfigUnitTest(unittest.TestCase):
12 """Tests the GitConfig class. 12 """Tests the GitConfig class.
13 """
14 def setUp(self):
15 """Create a GitConfig object using the test.gitconfig fixture.
16 """
17 config_fixture = fixture('test.gitconfig')
18 self.config = git_config.GitConfig(config_fixture)
19
20 def test_GetString_with_empty_config_values(self):
21 """
22 Test config entries with no value.
23
24 [section]
25 empty
26
27 """
28 val = self.config.GetString('section.empty')
29 self.assertEqual(val, None)
30
31 def test_GetString_with_true_value(self):
32 """
33 Test config entries with a string value.
34
35 [section]
36 nonempty = true
37
38 """
39 val = self.config.GetString('section.nonempty')
40 self.assertEqual(val, 'true')
41
42 def test_GetString_from_missing_file(self):
43 """
44 Test missing config file
13 """ 45 """
14 def setUp(self): 46 config_fixture = fixture('not.present.gitconfig')
15 """Create a GitConfig object using the test.gitconfig fixture. 47 config = git_config.GitConfig(config_fixture)
16 """ 48 val = config.GetString('empty')
17 config_fixture = fixture('test.gitconfig') 49 self.assertEqual(val, None)
18 self.config = git_config.GitConfig(config_fixture)
19
20 def test_GetString_with_empty_config_values(self):
21 """
22 Test config entries with no value.
23
24 [section]
25 empty
26
27 """
28 val = self.config.GetString('section.empty')
29 self.assertEqual(val, None)
30
31 def test_GetString_with_true_value(self):
32 """
33 Test config entries with a string value.
34
35 [section]
36 nonempty = true
37
38 """
39 val = self.config.GetString('section.nonempty')
40 self.assertEqual(val, 'true')
41
42 def test_GetString_from_missing_file(self):
43 """
44 Test missing config file
45 """
46 config_fixture = fixture('not.present.gitconfig')
47 config = git_config.GitConfig(config_fixture)
48 val = config.GetString('empty')
49 self.assertEqual(val, None)
50 50
51if __name__ == '__main__': 51if __name__ == '__main__':
52 unittest.main() 52 unittest.main()