MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / testCert

Method testCert

src/Test/TestUser.py:32–50  ·  view source on GitHub ↗
(self, user)

Source from the content-addressed store, hash-verified

30 assert CryptBitcoin.privatekeyToAddress(auth_privatekey) == auth_address
31
32 def testCert(self, user):
33 cert_auth_address = user.getAuthAddress("1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz") # Add site to user's registry
34 # Add cert
35 user.addCert(cert_auth_address, "zeroid.bit", "faketype", "fakeuser", "fakesign")
36 user.setCert("1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr", "zeroid.bit")
37
38 # By using certificate the auth address should be same as the certificate provider
39 assert user.getAuthAddress("1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr") == cert_auth_address
40 auth_privatekey = user.getAuthPrivatekey("1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr")
41 assert CryptBitcoin.privatekeyToAddress(auth_privatekey) == cert_auth_address
42
43 # Test delete site data
44 assert "1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr" in user.sites
45 user.deleteSiteData("1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr")
46 assert "1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr" not in user.sites
47
48 # Re-create add site should generate normal, unique auth_address
49 assert not user.getAuthAddress("1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr") == cert_auth_address
50 assert user.getAuthAddress("1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr") == "1MyJgYQjeEkR9QD66nkfJc9zqi9uUy5Lr2"

Callers

nothing calls this directly

Calls 5

getAuthAddressMethod · 0.80
addCertMethod · 0.80
setCertMethod · 0.80
getAuthPrivatekeyMethod · 0.80
deleteSiteDataMethod · 0.80

Tested by

no test coverage detected