Mercurial > public > mercurial-scm > python-hglib
annotate tests/test-push.py @ 146:8d7bf729a4db
hglib: use io.BytesIO when available (issue4520)
Since cStringIO.StringIO is not available in Python 3, try to use
io.BytesIO when available.
author | Brett Cannon <brett@python.org> |
---|---|
date | Fri, 13 Mar 2015 11:34:52 -0400 |
parents | 4359cabcb0cc |
children | c1b966866ed7 |
rev | line source |
---|---|
39 | 1 import common, hglib |
143
4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents:
39
diff
changeset
|
2 from hglib.util import b |
39 | 3 |
4 class test_push(common.basetest): | |
5 def test_basic(self): | |
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:
39
diff
changeset
|
7 self.client.commit(b('first'), addremove=True) |
39 | 8 |
143
4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents:
39
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:
39
diff
changeset
|
10 other = hglib.open(b('other')) |
39 | 11 |
12 # broken in hg, doesn't return 1 if nothing to push | |
13 #self.assertFalse(self.client.push('other')) | |
14 | |
15 self.append('a', 'a') | |
143
4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents:
39
diff
changeset
|
16 self.client.commit(b('second')) |
39 | 17 |
143
4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents:
39
diff
changeset
|
18 self.assertTrue(self.client.push(b('other'))) |
39 | 19 self.assertEquals(self.client.log(), other.log()) |