update test to use callback
From: "Brian C. Lane" <bcl@redhat.com>
---
testpyisomd5sum.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/testpyisomd5sum.py b/testpyisomd5sum.py
index c20f582..7158f78 100755
--- a/testpyisomd5sum.py
+++ b/testpyisomd5sum.py
@@ -18,5 +18,20 @@ print "Implanting again forcing -> ", pyisomd5sum.implantisomd5sum("testiso.iso"
# check it
print "Checking -> ",pyisomd5sum.checkisomd5sum("testiso.iso")
+def callback(offset, total):
+ print "%s - %s" % (offset, total)
+
+print "Run with callback"
+pyisomd5sum.checkisomd5sum("testiso.iso", callback)
+
+def callback_abort(offset, total):
+ print "%s - %s" % (offset, total)
+ if offset > 500000:
+ return True
+ return False
+
+print "Run with callback and abort after offset of 500000"
+pyisomd5sum.checkisomd5sum("testiso.iso", callback_abort)
+
# clean up
os.unlink("testiso.iso")
--
1.7.7.6
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
|