annotate tests/test-pull.py @ 147:98829bf71f10

util: define BytesIO in one place
author Matt Mackall <mpm@selenic.com>
date Fri, 13 Mar 2015 12:28:06 -0500
parents 4359cabcb0cc
children c1b966866ed7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40
238efe4fd7db client: add pull 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: 40
diff changeset
2 from hglib.util import b
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 class test_pull(common.basetest):
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 def test_basic(self):
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 self.append('a', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
7 self.client.commit(b('first'), addremove=True)
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
9 self.client.clone(dest=b('other'))
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
10 other = hglib.open(b('other'))
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 self.append('a', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
13 self.client.commit(b('second'))
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15 self.assertTrue(other.pull())
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16 self.assertEquals(self.client.log(), other.log())
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 def test_unresolved(self):
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 self.append('a', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
20 self.client.commit(b('first'), addremove=True)
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
22 self.client.clone(dest=b('other'))
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
23 other = hglib.open(b('other'))
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25 self.append('a', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
26 self.client.commit(b('second'))
40
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
28 self.append('other/a', 'b')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29 self.assertFalse(other.pull(update=True))
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 40
diff changeset
30 self.assertTrue((b('M'), b('a')) in other.status())