Mercurial > python-hglib
comparison tests/test-import.py @ 13:400cb1520834
client: add missing options to import_()
and don't read the file before calling hg, just pass it as one of the arguments
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Wed, 10 Aug 2011 00:42:43 +0300 |
parents | eac8be119d81 |
children | a0328b08e028 |
comparison
equal
deleted
inserted
replaced
12:c2a9b716cd80 | 13:400cb1520834 |
---|---|
1 import common, cStringIO | 1 import common, cStringIO |
2 import hglib | 2 import hglib |
3 | 3 |
4 class test_import(common.basetest): | 4 patch = """ |
5 def test_basic(self): | |
6 patch = """ | |
7 # HG changeset patch | 5 # HG changeset patch |
8 # User test | 6 # User test |
9 # Date 0 0 | 7 # Date 0 0 |
10 # Node ID c103a3dec114d882c98382d684d8af798d09d857 | 8 # Node ID c103a3dec114d882c98382d684d8af798d09d857 |
11 # Parent 0000000000000000000000000000000000000000 | 9 # Parent 0000000000000000000000000000000000000000 |
15 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 13 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
16 +++ b/a Thu Jan 01 00:00:00 1970 +0000 | 14 +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
17 @@ -0,0 +1,1 @@ | 15 @@ -0,0 +1,1 @@ |
18 +1 | 16 +1 |
19 """ | 17 """ |
18 | |
19 class test_import(common.basetest): | |
20 def test_basic_cstringio(self): | |
20 self.client.import_(cStringIO.StringIO(patch)) | 21 self.client.import_(cStringIO.StringIO(patch)) |
21 self.assertEquals(self.client.cat(['a']), '1\n') | 22 self.assertEquals(self.client.cat(['a']), '1\n') |
23 | |
24 def test_basic_file(self): | |
25 open('patch', 'w').write(patch) | |
26 self.client.import_(['patch']) | |
27 self.assertEquals(self.client.cat(['a']), '1\n') |