Fix unit tests

This commit is contained in:
Andrey Pohilko 2012-09-21 15:17:21 +04:00
parent 6c3e198090
commit 01d277b804
2 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,7 @@ from Tests.ConsoleOnlinePluginTest import FakeConsoleMarkup
from Tests.TankTests import TankTestCase
import logging
import time
import tempfile
class MonitoringCollectorTestCase(TankTestCase):
data = None
@ -23,6 +24,7 @@ class MonitoringCollectorTestCase(TankTestCase):
def test_plugin_disabled(self):
core = TankCore()
core.artifacts_base_dir=tempfile.mkdtemp()
mon = MonitoringPlugin(core)
core.set_option(mon.SECTION, 'config', 'none')
mon.configure()
@ -37,6 +39,7 @@ class MonitoringCollectorTestCase(TankTestCase):
def test_plugin_default(self):
core = TankCore()
core.artifacts_base_dir=tempfile.mkdtemp()
core.load_configs(['config/monitoring.conf'])
core.load_plugins()
core.plugins_configure()
@ -55,6 +58,7 @@ class MonitoringCollectorTestCase(TankTestCase):
def test_plugin_config(self):
core = TankCore()
core.artifacts_base_dir=tempfile.mkdtemp()
core.load_configs(['config/monitoring.conf'])
core.load_plugins()
core.plugins_configure()
@ -74,6 +78,7 @@ class MonitoringCollectorTestCase(TankTestCase):
def test_widget(self):
core = TankCore()
core.artifacts_base_dir=tempfile.mkdtemp()
owner = MonitoringPlugin(core)
owner.monitoring=1
widget = MonitoringWidget(owner)

View File

@ -10,6 +10,7 @@ from Tank.Plugins.Aggregator import AggregatorPlugin
class PhantomPluginTestCase(TankTestCase):
def setUp(self):
core = TankCore()
core.artifacts_base_dir=tempfile.mkdtemp()
(name) = tempfile.mkstemp()[1]
core.config.set_out_file(name)
core.load_configs(['config/phantom.conf'])