From e45d964b627735b37ec177bbdbaf4f11846f194c Mon Sep 17 00:00:00 2001 From: Dileep Ranganathan Date: Fri, 21 Sep 2018 09:13:31 -0700 Subject: 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 --- conductor/conductor/tests/unit/solver/test_order_lock_service.py | 6 ++++++ conductor/conductor/tests/unit/solver/test_solver_parser.py | 6 ++++++ 2 files changed, 12 insertions(+) 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']) -- cgit 1.2.3-korg