annotate tests/test-resolve.py @ 145:f3c430afa598

hglib: abstract out use of cStringIO.StringIO (issue4520) The cStringIO module does not exist in Python 3, but io.BytesIO does. This change prepares for the use of io.BytesIO when available by replacing all uses of cStringIO.StringIO with an object named BytesIO.
author Brett Cannon <brett@python.org>
date Fri, 13 Mar 2015 11:31:54 -0400
parents 4359cabcb0cc
children c1b966866ed7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common, hglib
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
2 from hglib.util import b
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 class test_resolve(common.basetest):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 def setUp(self):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 common.basetest.setUp(self)
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.append('a', 'a')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 self.append('b', 'b')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
10 rev, self.node0 = self.client.commit(b('first'), addremove=True)
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 self.append('a', 'a')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 self.append('b', 'b')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
14 rev, self.node1 = self.client.commit(b('second'))
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16 def test_basic(self):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 self.client.update(self.node0)
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 self.append('a', 'b')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 self.append('b', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
20 rev, self.node3 = self.client.commit(b('third'))
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21
134
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
22 self.assertRaises(hglib.error.CommandError, self.client.merge,
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
23 self.node1)
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
24 self.assertRaises(hglib.error.CommandError,
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
25 self.client.resolve, all=True)
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
26
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
27 self.assertEquals([(b('U'), b('a')), (b('U'), b('b'))],
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
28 self.client.resolve(listfiles=True))
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
30 self.client.resolve(b('a'), mark=True)
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
31 self.assertEquals([(b('R'), b('a')), (b('U'), b('b'))],
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
32 self.client.resolve(listfiles=True))