summaryrefslogtreecommitdiffstats
path: root/conductor
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2018-09-21 09:13:31 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2018-09-24 00:43:00 -0700
commite45d964b627735b37ec177bbdbaf4f11846f194c (patch)
treecc65a3a3b07459f14d21379a9aea98692e757fac /conductor
parent4f5bfd835c01ccc7b79d0bce048fe0684c6c945a (diff)
Fix AttributeError 'MUSIC_API' for tox
Fix AttributeError: 'module' object has no attribute 'MUSIC_API' while running tox manually Change-Id: I2a826b6a0628eb6430953c66256dee89001f2ab5 Issue-ID: OPTFRA-358 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Diffstat (limited to 'conductor')
-rw-r--r--conductor/conductor/tests/unit/solver/test_order_lock_service.py6
-rw-r--r--conductor/conductor/tests/unit/solver/test_solver_parser.py6
2 files changed, 12 insertions, 0 deletions
diff --git a/conductor/conductor/tests/unit/solver/test_order_lock_service.py b/conductor/conductor/tests/unit/solver/test_order_lock_service.py
index 0050a1d..141aa6e 100644
--- a/conductor/conductor/tests/unit/solver/test_order_lock_service.py
+++ b/conductor/conductor/tests/unit/solver/test_order_lock_service.py
@@ -23,11 +23,17 @@ import unittest
import uuid
from conductor.common.models.order_lock import OrderLock
+from conductor.common.music import api
from conductor.solver.orders_lock.orders_lock_service import OrdersLockingService
+from oslo_config import cfg
class TestOrdersLockingService(unittest.TestCase):
def setUp(self):
+ # Initialize music API
+ music = api.API()
+ cfg.CONF.set_override('keyspace', 'conductor')
+ music.keyspace_create(keyspace=cfg.CONF.keyspace)
self.order_lock_svc = OrdersLockingService()
def test_update_order_status(self):
diff --git a/conductor/conductor/tests/unit/solver/test_solver_parser.py b/conductor/conductor/tests/unit/solver/test_solver_parser.py
index 94b544f..e5ba50b 100644
--- a/conductor/conductor/tests/unit/solver/test_solver_parser.py
+++ b/conductor/conductor/tests/unit/solver/test_solver_parser.py
@@ -20,17 +20,23 @@
import mock
import unittest
+from conductor.common.music import api
from conductor.solver.request import demand
from conductor.solver.request.parser import Parser as SolverRequestParser
from conductor.solver.optimizer.constraints import access_distance as access_dist
from conductor.solver.triage_tool.traige_latency import TriageLatency
from collections import OrderedDict
+from oslo_config import cfg
class TestSolverParser(unittest.TestCase):
def setUp(self):
+ # Initialize music API
+ music = api.API()
+ cfg.CONF.set_override('keyspace', 'conductor')
+ music.keyspace_create(keyspace=cfg.CONF.keyspace)
self.sp = SolverRequestParser()
c1 = access_dist.AccessDistance(_name = 'c1', _type = 't1', _demand_list = ['d1', 'd2'])