# Path: scalymongo/errors.py
# class GlobalQueryException(Exception):
#     """Raised when a query will hit multiple shards.
# 
#     This exception is raised by default when doing a
#     :meth:`~scalymongo.document.Document.find`,
#     :meth:`~scalymongo.document.Document.remove` or any other type of query
#     when the query is likely to hit multiple shards.  This check is done in
#     order to warn developers of behavior that may not perform well at scale.
# 
#     """
#     pass
# 
# class ModifyFailedError(Exception):
#     """Raised when :meth:`~scalymongo.document.Document.modify` fails."""
#     pass


from deterministic_dingus import DeterministicDingus
from dingus import DingusTestCase, Dingus, exception_raiser
from nose.tools import assert_raises
from scalymongo.document import *
from scalymongo.errors import GlobalQueryException, ModifyFailedError
import scalymongo.document as mod
        BaseDocumentSubclassTest.setup(self)
        self.MyDoc.check_query_sharding = Dingus('check_query_sharding')
        self.query = self.spec = Dingus('spec')


class PropertyRemovingFromCollection(object):

    def should_remove_from_collection(self):
        assert self.MyDoc.collection.calls('remove', self.spec)

    def should_return_result(self):
        assert self.MyDoc.collection.calls('remove').once()
        assert self.returned == self.MyDoc.collection.remove()


class PropertyRemovingFromCollectionWithKWArgs(
    PropertyRemovingFromCollection):

    def should_remove_from_collection_with_kwargs(self):
        assert self.MyDoc.collection.calls(
            'remove', self.spec, **self.kwargs)


class TestRemoveWithAllowGlobalFalse(
    BaseRemove,
    PropertyAllowGlobalIsFalse,
    PropertyRemovingFromCollection,
    ):

    def setup(self):

# Path: scalymongo/errors.py
# class GlobalQueryException(Exception):
#     """Raised when a query will hit multiple shards.
# 
#     This exception is raised by default when doing a
#     :meth:`~scalymongo.document.Document.find`,
#     :meth:`~scalymongo.document.Document.remove` or any other type of query
#     when the query is likely to hit multiple shards.  This check is done in
#     order to warn developers of behavior that may not perform well at scale.
# 
#     """
#     pass
# 
# class ModifyFailedError(Exception):
#     """Raised when :meth:`~scalymongo.document.Document.modify` fails."""
#     pass


# Path: tests/unit/test_document.py
from deterministic_dingus import DeterministicDingus
from dingus import DingusTestCase, Dingus, exception_raiser
from nose.tools import assert_raises
from scalymongo.document import *
from scalymongo.errors import GlobalQueryException, ModifyFailedError
import scalymongo.document as mod

        BaseDocumentSubclassTest.setup(self)
        self.MyDoc.check_query_sharding = Dingus('check_query_sharding')
        self.query = self.spec = Dingus('spec')


class PropertyRemovingFromCollection(object):

    def should_remove_from_collection(self):
        assert self.MyDoc.collection.calls('remove', self.spec)

    def should_return_result(self):
        assert self.MyDoc.collection.calls('remove').once()
        assert self.returned == self.MyDoc.collection.remove()


class PropertyRemovingFromCollectionWithKWArgs(
    PropertyRemovingFromCollection):

    def should_remove_from_collection_with_kwargs(self):
        assert self.MyDoc.collection.calls(
            'remove', self.spec, **self.kwargs)


class TestRemoveWithAllowGlobalFalse(
    BaseRemove,
    PropertyAllowGlobalIsFalse,
    PropertyRemovingFromCollection,
    ):

    def setup(self):

        BaseRemove.setup(self)