Пример #1
0
 def test_202_102(self):
     acct = self._prepare_account(["*****@*****.**"])
     with open(TestEnv.path_account(acct)) as f:
         acctj = json.load(f)
     acctj['url'] = acctj['url'] + "0"
     open(TestEnv.path_account(acct), "w").write(json.dumps(acctj))
     assert TestEnv.a2md( ["acme", "validate", acct] )['rv'] == 1
Пример #2
0
 def _check_account(self, acct, contact, tos):
     with open(TestEnv.path_account(acct)) as f:
         acctj = json.load(f)
     assert acctj['registration']['contact'] == contact
     if tos:
         assert acctj['agreement'] == tos
     else:
         assert 'agreement' not in acctj
Пример #3
0
 def _check_account(self, acct, contact, tos):
     # read account data from store
     # TODO: create a "a2md list accounts" command for this
     jout = TestEnv.run(["cat", TestEnv.path_account(acct)])['jout']
     assert jout['registration']['contact'] == contact
     if tos:
         assert jout['agreement'] == tos
     else:
         assert 'agreement' not in jout
Пример #4
0
 def test_200_102(self):
     # test case: report fail on request signing problem
     # create new account
     acct = self._prepare_account(["*****@*****.**"])
     # modify server's reg url
     # TODO: find storage-independent way to modify local registration data
     jsonFile = TestEnv.path_account(acct)
     jout = TestEnv.run(["cat", jsonFile])['jout']
     jout['url'] = jout['url'] + "0"
     open(jsonFile, "w").write(json.dumps(jout))
     # validate account
     assert TestEnv.a2md(["acme", "validate", acct])['rv'] == 1
Пример #5
0
 def _check_account(self, acct, contact):
     # read account data from store
     # TODO: create a "a2md list accounts" command for this
     jout = TestEnv.run(["cat", TestEnv.path_account(acct)])['jout']
     assert jout['id'] == acct
     assert jout['registration']['contact'] == contact
Пример #6
0
 def _check_account(self, acct, contact):
     with open(TestEnv.path_account(acct)) as f:
         acctj = json.load(f)
     assert acctj['registration']['contact'] == contact