def setUp(self): here = os.getcwd() topdir = here.rstrip('_trial_temp') self.rundir = os.path.join(topdir, 'run') self.pidfile = os.path.join(self.rundir, 'bridgedb.pid') self.pid = getBridgeDBPID(self.pidfile) self.assignmentsFile = os.path.join(self.rundir, 'assignments.log')
def setUp(self): '''Called at the start of each test, ensures that the SMTP server is running. ''' here = os.getcwd() topdir = here.rstrip('_trial_temp') self.rundir = os.path.join(topdir, 'run') self.pidfile = os.path.join(self.rundir, 'bridgedb.pid') self.pid = getBridgeDBPID(self.pidfile) self.server = EmailServer.startServer()
from twisted.trial.unittest import FailTest from twisted.trial.unittest import SkipTest from bridgedb.test.test_Tests import DynamicTestCaseMeta from bridgedb.test.util import processExists from bridgedb.test.util import getBridgeDBPID HTTP_ROOT = 'http://127.0.0.1:6788' CAPTCHA_RESPONSE = 'Tvx74Pmy' TOPDIR = os.getcwd() while not TOPDIR.endswith('bridgedb'): TOPDIR = os.path.dirname(TOPDIR) PIDFILE = os.path.join(TOPDIR, 'run', 'bridgedb.pid') PID = getBridgeDBPID(PIDFILE) class HTTPTests(unittest.TestCase): def setUp(self): if not os.environ.get("CI"): raise SkipTest(("The mechanize tests cannot handle self-signed " "TLS certificates, and thus require opening " "another port for running a plaintext HTTP-only " "BridgeDB webserver. Because of this, these tests " "are only run on CI servers.")) if not PID or not processExists(PID): raise FailTest("Could not start BridgeDB process on CI server!") self.br = None
from twisted.trial.unittest import SkipTest from bridgedb.test.test_Tests import DynamicTestCaseMeta from bridgedb.test.util import processExists from bridgedb.test.util import getBridgeDBPID HTTP_ROOT = 'http://127.0.0.1:6788' CAPTCHA_RESPONSE = 'Tvx74Pmy' TOPDIR = os.getcwd() while not TOPDIR.endswith('bridgedb'): TOPDIR = os.path.dirname(TOPDIR) PIDFILE = os.path.join(TOPDIR, 'run', 'bridgedb.pid') PID = getBridgeDBPID(PIDFILE) class HTTPTests(unittest.TestCase): def setUp(self): if not os.environ.get("CI"): raise SkipTest(("The mechanize tests cannot handle self-signed " "TLS certificates, and thus require opening " "another port for running a plaintext HTTP-only " "BridgeDB webserver. Because of this, these tests " "are only run on CI servers.")) if not PID or not processExists(PID): raise FailTest("Could not start BridgeDB process on CI server!") self.br = None