diff tests/test-import.py @ 96:9746227239e0

client: fix import --no-commit flag (issue3206)
author Idan Kamara <idankk86@gmail.com>
date Mon, 16 Jan 2012 12:52:30 +0200
parents a0328b08e028
children e738d6fe5f3f
line wrap: on
line diff
--- a/tests/test-import.py	Thu Dec 22 19:12:47 2011 +0200
+++ b/tests/test-import.py	Mon Jan 16 12:52:30 2012 +0200
@@ -1,4 +1,4 @@
-import common, cStringIO
+import common, cStringIO, os
 import hglib
 
 patch = """
@@ -23,5 +23,13 @@
 
     def test_basic_file(self):
         open('patch', 'wb').write(patch)
+
+        # --no-commit
+        self.client.import_(['patch'], nocommit=True)
+        self.assertEquals(open('a').read(), '1\n')
+
+        self.client.update(clean=True)
+        os.remove('a')
+
         self.client.import_(['patch'])
         self.assertEquals(self.client.cat(['a']), '1\n')