def _start_web_server(cls): if not MailpileSeleniumTest.http_worker: (mp, session, config, _) = get_shared_mailpile() sspec = MailpileSeleniumTest._get_mailpile_sspec() MailpileSeleniumTest.http_worker = config.http_worker = HttpWorker( session, sspec) config.http_worker.start()
def __init__(self): self.mp = get_shared_mailpile()[0] self.mp.set("sys.postinglist_kb=%s" % postinglist_kb) self.mp.set("prefs.num_results=50") self.mp.set("prefs.default_order=rev-date") results = self.mp.search(*query) assert_less(float(results.as_dict()["elapsed"]), 0.2)
def __init__(self): self.mp = get_shared_mailpile()[0] results = self.mp.search(*query) try: assert_equal(results.result['stats']['count'], expected_count) assert_less(float(results.as_dict()["elapsed"]), 0.2) except: print 'BAD RESULT:\n%s' % results.as_text() raise
def __init__(self): self.mp = get_shared_mailpile()[0] results = self.mp.search(*query) try: assert_equal(results.result['stats']['count'], expected_count) assert_less(float(results.as_dict()["elapsed"]), 0.2) except: print 'BAD RESULT:\n{0!s}'.format(results.as_text()) raise
def __init__(self): self.mp = get_shared_mailpile()[0] results = self.mp.search(*query) try: assert_equal(results.result["stats"]["count"], expected_count) assert_less(float(results.as_dict()["elapsed"]), 0.2) except: print "BAD RESULT:\n%s" % results.as_text() raise
def test_lookup(self): with patch('DNS.Request') as dns_mock, patch('mailpile.crypto.gpgi.GnuPG.search_key') as gpg_mock: gpg_mock.return_value = GPG_MOCK_RETURN dns_mock.return_value.req.return_value.answers = DNSPKA_MOCK_RETURN m = get_shared_mailpile()[0] res = lookup_crypto_keys(m._session, '*****@*****.**') self.assertIsNotNone(res) self.assertEqual(type(res), list) for r in res: self.assertEqual(type(r), dict)
def test_lookup_emailkeys(self): m = get_shared_mailpile()[0] d = EmailKeyLookupHandler(m._session, {}) res = d.lookup('*****@*****.**') self.assertIsNotNone(res)
def _stop_web_server(cls): if MailpileSeleniumTest.http_worker: (mp, _, config, _) = get_shared_mailpile() mp._config.http_worker = None MailpileSeleniumTest.http_worker.quit() MailpileSeleniumTest.http_worker = MailpileSeleniumTest.http_worker = None
def _get_mailpile_sspec(cls): (_, _, config, _) = get_shared_mailpile() return (config.sys.http_host, config.sys.http_port, config.sys.http_path)
def _start_web_server(cls): if not MailpileSeleniumTest.http_worker: (mp, session, config, _) = get_shared_mailpile() sspec = MailpileSeleniumTest._get_mailpile_sspec() MailpileSeleniumTest.http_worker = config.http_worker = HttpWorker(session, sspec) config.http_worker.start()
def _get_mailpile_sspec(cls): (_, _, config, _) = get_shared_mailpile() return (config.sys.http_host, config.sys.http_port)