Clean imports in code

In some part in the code we import objects.
In the Openstack style guidelines they recommand to import
only modules. We need to fix that.

Change-Id: I268c5045f00d25b4dfbf77c1f599c7baca8373ed
Partial-Bug:1543101
This commit is contained in:
Nguyen Hung Phuong 2016-08-15 13:40:56 +07:00
parent 196a7a5457
commit 17d2d75abb

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock import mock
from testtools.matchers import HasLength from testtools import matchers
from watcher.common import exception from watcher.common import exception
from watcher import objects from watcher import objects
@ -57,7 +58,7 @@ class TestStrategyObject(base.DbTestCase):
mock_get_list.return_value = [self.fake_strategy] mock_get_list.return_value = [self.fake_strategy]
strategies = objects.Strategy.list(self.context) strategies = objects.Strategy.list(self.context)
self.assertEqual(1, mock_get_list.call_count, 1) self.assertEqual(1, mock_get_list.call_count, 1)
self.assertThat(strategies, HasLength(1)) self.assertThat(strategies, matchers.HasLength(1))
self.assertIsInstance(strategies[0], objects.Strategy) self.assertIsInstance(strategies[0], objects.Strategy)
self.assertEqual(self.context, strategies[0]._context) self.assertEqual(self.context, strategies[0]._context)