def test_lifecycle(self): wamptest.TestCase.quiet = True wamptest.TestCase.test = True result = wamptest.main( test_cases=[self.ExampleTestCase, self.ExampleTestCase], url=u"test", realm=u"test", quiet=True, test=True ) self.assertEqual(4, result) self.assertEqual(2, self.ExampleTestCase._setup_class_count) self.assertEqual(2, self.ExampleTestCase._teardown_class_count) self.assertEqual(8, self.ExampleTestCase._setup_count) self.assertEqual(8, self.ExampleTestCase._teardown_count)
from twisted.internet.defer import inlineCallbacks import wamptest import os import sys class AppTests(wamptest.TestCase): @inlineCallbacks def test_call(self): response = yield self.call("com.example.test") self.assertTrue(response) if __name__ == '__main__': realm = unicode(os.environ['ROUTER_REALM']) url = unicode(os.environ['ROUTER_URL']) errors = wamptest.main(test_cases=[AppTests], url=url, realm=realm, user="******", secret="secret") sys.exit(errors)
from twisted.internet.defer import inlineCallbacks import wamptest import os import sys class AppTests(wamptest.TestCase): @inlineCallbacks def test_call(self): response = yield self.call("com.example.test") self.assertTrue(response) if __name__ == '__main__': realm = unicode(os.environ['ROUTER_REALM']) url = unicode(os.environ['ROUTER_URL']) errors = wamptest.main( test_cases=[AppTests], url=url, realm=realm, user="******", secret="secret" ) sys.exit(errors)