Mercurial > python-hglib
comparison tests/test-paths.py @ 143:4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
author | Brett Cannon <brett@python.org> |
---|---|
date | Mon, 09 Mar 2015 18:26:25 -0400 |
parents | e738d6fe5f3f |
children | c1b966866ed7 |
comparison
equal
deleted
inserted
replaced
142:fe74d5599539 | 143:4359cabcb0cc |
---|---|
1 import common, os | 1 import common, os |
2 import hglib | 2 import hglib |
3 from hglib.util import b | |
3 | 4 |
4 class test_paths(common.basetest): | 5 class test_paths(common.basetest): |
5 def test_basic(self): | 6 def test_basic(self): |
6 f = open('.hg/hgrc', 'a') | 7 f = open('.hg/hgrc', 'a') |
7 f.write('[paths]\nfoo = bar\n') | 8 f.write('[paths]\nfoo = bar\n') |
9 | 10 |
10 # hgrc isn't watched for changes yet, have to reopen | 11 # hgrc isn't watched for changes yet, have to reopen |
11 self.client = hglib.open() | 12 self.client = hglib.open() |
12 paths = self.client.paths() | 13 paths = self.client.paths() |
13 self.assertEquals(len(paths), 1) | 14 self.assertEquals(len(paths), 1) |
14 self.assertEquals(paths['foo'], os.path.abspath('bar')) | 15 self.assertEquals(paths[b('foo')], |
15 self.assertEquals(self.client.paths('foo'), os.path.abspath('bar')) | 16 os.path.abspath('bar').encode('latin-1')) |
17 self.assertEquals(self.client.paths(b('foo')), | |
18 os.path.abspath('bar').encode('latin-1')) |