annotate tests/test-pull.py @ 75:f4f636ecca3e

tests: add a nose plugin that allows specifying a custom hg to run tests
author Idan Kamara <idankk86@gmail.com>
date Sat, 15 Oct 2011 20:03:04 +0200
parents 238efe4fd7db
children 4359cabcb0cc
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
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_pull(common.basetest):
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def test_basic(self):
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 self.append('a', 'a')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 self.client.commit('first', addremove=True)
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.client.clone(dest='other')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 other = hglib.open('other')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 self.append('a', 'a')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 self.client.commit('second')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.assertTrue(other.pull())
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15 self.assertEquals(self.client.log(), other.log())
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 def test_unresolved(self):
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 self.append('a', 'a')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 self.client.commit('first', addremove=True)
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21 self.client.clone(dest='other')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22 other = hglib.open('other')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
23
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24 self.append('a', 'a')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25 self.client.commit('second')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
26
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27 self.append('other/a', 'b')
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
28 self.assertFalse(other.pull(update=True))
238efe4fd7db client: add pull command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29 self.assertTrue(('M', 'a') in other.status())