Mercurial > python-hglib
annotate tests/test-config.py @ 124:cc7569bffb26
context: add 'hidden' method to check if the changeset is hidden
This method should not be a static property obtained at creation as the hidden
status may change.
author | Paul Tonelli <paul.tonelli@logilab.fr> |
---|---|
date | Thu, 15 May 2014 15:12:13 +0200 |
parents | e738d6fe5f3f |
children | 9ecb271600fc |
rev | line source |
---|---|
21 | 1 import os, common, hglib |
2 | |
3 class test_config(common.basetest): | |
4 def setUp(self): | |
5 common.basetest.setUp(self) | |
118
e738d6fe5f3f
tests: make the tests work under Pypy (issue3965)
Matt Mackall <mpm@selenic.com>
parents:
21
diff
changeset
|
6 f = open('.hg/hgrc', 'a') |
e738d6fe5f3f
tests: make the tests work under Pypy (issue3965)
Matt Mackall <mpm@selenic.com>
parents:
21
diff
changeset
|
7 f.write('[section]\nkey=value\n') |
e738d6fe5f3f
tests: make the tests work under Pypy (issue3965)
Matt Mackall <mpm@selenic.com>
parents:
21
diff
changeset
|
8 f.close() |
21 | 9 self.client = hglib.open() |
10 | |
11 def test_basic(self): | |
12 config = self.client.config() | |
13 | |
14 self.assertTrue(('section', 'key', 'value') in self.client.config()) | |
15 | |
16 self.assertTrue([('section', 'key', 'value')], | |
17 self.client.config('section')) | |
18 self.assertTrue([('section', 'key', 'value')], | |
19 self.client.config(['section', 'foo'])) | |
20 self.assertRaises(hglib.error.CommandError, | |
21 self.client.config, ['a.b', 'foo']) | |
22 | |
23 def test_show_source(self): | |
24 config = self.client.config(showsource=True) | |
25 | |
26 self.assertTrue((os.path.abspath('.hg/hgrc') + ':2', | |
27 'section', 'key', 'value') in config) |