yandex-tank/Tests/TankCoreTest.py
2012-09-21 15:47:37 +04:00

40 lines
1022 B
Python

from Tank.Core import TankCore
from Tests.TankTests import TankTestCase
import os
import tempfile
import unittest
class TankCoreTestCase(TankTestCase):
def setUp(self):
self.foo = self.get_core()
(handler, name) = tempfile.mkstemp()
self.foo.config.set_out_file(name)
def tearDown(self):
del self.foo
self.foo = None
def test_tankCoreFail(self):
paths = ['config_err/load_err.conf']
self.foo.load_configs(paths)
try:
self.foo.load_plugins()
self.fail()
except ImportError:
pass
def test_tankCore(self):
paths = ['config/load.conf']
self.foo.load_configs(paths)
self.foo.load_plugins()
self.foo.plugins_configure()
self.foo.plugins_prepare_test()
self.foo.plugins_start_test()
self.foo.wait_for_finish()
self.foo.add_artifact_file(__file__, 1)
self.foo.plugins_end_test(0)
if __name__ == '__main__':
unittest.main()