Removed dependency on flask_pymongo
This commit is contained in:
parent
559e212c55
commit
8a0f582a80
@ -1,7 +1,7 @@
|
|||||||
"""Code for moving around nodes."""
|
"""Code for moving around nodes."""
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
import flask_pymongo.wrappers
|
import pymongo.database
|
||||||
from bson import ObjectId
|
from bson import ObjectId
|
||||||
|
|
||||||
from pillar import attrs_extra
|
from pillar import attrs_extra
|
||||||
@ -10,7 +10,7 @@ import pillar.api.file_storage.moving
|
|||||||
|
|
||||||
@attr.s
|
@attr.s
|
||||||
class NodeMover(object):
|
class NodeMover(object):
|
||||||
db = attr.ib(validator=attr.validators.instance_of(flask_pymongo.wrappers.Database))
|
db = attr.ib(validator=attr.validators.instance_of(pymongo.database.Database))
|
||||||
skip_gcs = attr.ib(default=False, validator=attr.validators.instance_of(bool))
|
skip_gcs = attr.ib(default=False, validator=attr.validators.instance_of(bool))
|
||||||
_log = attrs_extra.log('%s.NodeMover' % __name__)
|
_log = attrs_extra.log('%s.NodeMover' % __name__)
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import unittest
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
from bson import ObjectId
|
from bson import ObjectId
|
||||||
import flask_pymongo.wrappers
|
import pymongo.database
|
||||||
|
|
||||||
# Required to mock this module, otherwise 'pillar.api.file_storage' doesn't have
|
# Required to mock this module, otherwise 'pillar.api.file_storage' doesn't have
|
||||||
# the attribute 'moving'
|
# the attribute 'moving'
|
||||||
@ -13,7 +13,7 @@ class NodeMoverTest(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
from pillar.api.nodes import moving
|
from pillar.api.nodes import moving
|
||||||
|
|
||||||
self.db = mock.MagicMock(spec=flask_pymongo.wrappers.Database)
|
self.db = mock.MagicMock(spec=pymongo.database.Database)
|
||||||
self.mover = moving.NodeMover(db=self.db)
|
self.mover = moving.NodeMover(db=self.db)
|
||||||
|
|
||||||
def test_file_generator(self):
|
def test_file_generator(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user