qtutils: Do not re-translate strings
[git-cola.git] / test / test_cola_gitcfg.py
blob41c22b752751ec8287ec3e1f23a97de62233b153
1 import unittest
3 import helper
4 from cola import gitcfg
7 class GitConfigTestCase(helper.GitRepositoryTestCase):
8 """Tests the cola.gitcmds module."""
9 def setUp(self):
10 helper.GitRepositoryTestCase.setUp(self)
11 self.config = gitcfg.instance()
13 def test_string(self):
14 """Test string values in get()."""
15 self.shell('git config test.value test')
16 self.assertEqual(self.config.get('test.value'), 'test')
18 def test_int(self):
19 """Test int values in get()."""
20 self.shell('git config test.int 42')
21 self.assertEqual(self.config.get('test.int'), 42)
23 def test_bool(self):
24 """Test bool values in get()."""
25 self.shell('git config test.bool true')
26 self.assertEqual(self.config.get('test.bool'), True)
27 self.shell('git config test.bool false')
28 self.assertEqual(self.config.get('test.bool'), False)
30 def test_default(self):
31 """Test default values in get()."""
32 self.assertEqual(self.config.get('does.not.exist'), None)
33 self.assertEqual(self.config.get('does.not.exist', default=42), 42)
36 if __name__ == '__main__':
37 unittest.main()