1 #!/usr/bin/env python2.3
2 from basetest
import BaseTest
3 import sys
, tempfile
, os
, shutil
6 thomas_fingerprint
= "92429807C9853C0744A68B9AAE07828059A53CC1"
8 sys
.path
.insert(0, '..')
9 from zeroinstall
.injector
import trust
, basedir
11 class TestTrust(BaseTest
):
13 assert not trust
.trust_db
.is_trusted(thomas_fingerprint
)
14 assert not trust
.trust_db
.is_trusted("1234")
15 assert len(trust
.trust_db
.keys
) == 0
17 def testAddInvalid(self
):
19 trust
.trust_db
.trust_key("hello")
25 assert not trust
.trust_db
.is_trusted("1234")
26 trust
.trust_db
.trust_key("1234")
27 assert trust
.trust_db
.is_trusted("1234")
28 assert not trust
.trust_db
.is_trusted("1236")
30 trust
.trust_db
.untrust_key("1234")
31 assert not trust
.trust_db
.is_trusted("1234")
33 def testParallel(self
):
37 assert b
.is_trusted("1")
40 assert not a
.is_trusted("1")
41 assert a
.is_trusted("2")
43 suite
= unittest
.makeSuite(TestTrust
)
44 if __name__
== '__main__':