SF.net SVN: fclient: [490] trunk/fcp2/src/fcp2/test_fcp/test_key.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-04 08:26:56
|
Revision: 490
http://fclient.svn.sourceforge.net/fclient/?rev=490&view=rev
Author: jUrner
Date: 2008-07-04 01:27:01 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
adapt to changes in key.py
Modified Paths:
--------------
trunk/fcp2/src/fcp2/test_fcp/test_key.py
Modified: trunk/fcp2/src/fcp2/test_fcp/test_key.py
===================================================================
--- trunk/fcp2/src/fcp2/test_fcp/test_key.py 2008-07-04 08:26:52 UTC (rev 489)
+++ trunk/fcp2/src/fcp2/test_fcp/test_key.py 2008-07-04 08:27:01 UTC (rev 490)
@@ -34,13 +34,13 @@
p = 'CHK@' + DummyKeyData + '/'
myKey = fcp2.KeyCHK.fromString(p)
self.assertEqual(myKey.keyData, DummyKeyData)
- self.failUnless(myKey.filename is None)
+ self.failUnless(myKey.docName is None)
self.assertEqual(myKey.toString(), p)
p = 'CHK@' + DummyKeyData + '/foo/'
myKey = fcp2.KeyCHK.fromString(p)
self.assertEqual(myKey.keyData, DummyKeyData)
- self.assertEqual(myKey.filename, 'foo')
+ self.assertEqual(myKey.docName, 'foo')
self.assertEqual(myKey.toString(), p)
p = 'CHK@'
@@ -52,14 +52,67 @@
pass
+class Test_SSK(unittest.TestCase):
+
+ def test_fromString(self):
+
+ p = 'SSK@' + DummyKeyData + '/foo-1/'
+ myKey = fcp2.KeySSK.fromString(p)
+ self.assertEqual(myKey.keyData, DummyKeyData)
+ self.assertEqual(myKey.docName, 'foo')
+ self.assertEqual(myKey.edition, 1)
+ self.assertEqual(myKey.toString(), p)
+
+
+ p = 'SSK@' + DummyKeyData + '/'
+ myKey = fcp2.KeySSK.fromString(p)
+ self.assertEqual(myKey.keyData, DummyKeyData)
+ self.assertEqual(myKey.docName, None)
+ self.assertEqual(myKey.edition, None)
+ self.assertEqual(myKey.toString(), p)
+
+
+
+ def test_toString(self):
+ pass
+
-
+class Test_USK(unittest.TestCase):
+
+ def test_fromString(self):
+
+ p = 'USK@' + DummyKeyData + '/foo/0/'
+ myKey = fcp2.KeyUSK.fromString(p)
+ self.assertEqual(myKey.keyData, DummyKeyData)
+ self.assertEqual(myKey.docName, 'foo')
+ self.assertEqual(myKey.edition, 0)
+ self.assertEqual(myKey.toString(), p)
+
+
+ p = 'USK@' + DummyKeyData + '/foo/-2/'
+ myKey = fcp2.KeyUSK.fromString(p)
+ self.assertEqual(myKey.keyData, DummyKeyData)
+ self.assertEqual(myKey.docName, 'foo')
+ self.assertEqual(myKey.edition, -2)
+ self.assertEqual(myKey.toString(), p)
+
+
+ p = 'USK@'
+ myKey = fcp2.KeyUSK.fromString(p)
+ self.failUnless(myKey is None)
+
+
+ def test_toString(self):
+ pass
+
#*********************************************************************************
#
#*********************************************************************************
def suite():
tests = (
Test_CHK,
+ Test_SSK,
+ Test_USK,
)
suite = unittest.TestSuite()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|