# 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
        self.spec = {'foo': Dingus(), 'bar': Dingus()}

        self.MyDoc.check_query_sharding(self.spec)

    def should_not_crash(self):
        pass


class WhenShardIndexNotSpecified(BaseDocumentSubclassTest):

    def setup(self):
        BaseDocumentSubclassTest.setup(self)
        self.MyDoc.shard_index = None
        self.spec = {'foo': Dingus(), 'bar': Dingus()}

        self.MyDoc.check_query_sharding(self.spec)

    def should_not_crash(self):
        pass


class WhenShardIndexNotSpecified(BaseDocumentSubclassTest):

    def setup(self):
        BaseDocumentSubclassTest.setup(self)
        self.MyDoc.shard_index = {'fields': ['biz']}
        self.spec = {'foo': Dingus()}

    def should_raise_global_query_exception(self):
        assert_raises(

# 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

        self.spec = {'foo': Dingus(), 'bar': Dingus()}

        self.MyDoc.check_query_sharding(self.spec)

    def should_not_crash(self):
        pass


class WhenShardIndexNotSpecified(BaseDocumentSubclassTest):

    def setup(self):
        BaseDocumentSubclassTest.setup(self)
        self.MyDoc.shard_index = None
        self.spec = {'foo': Dingus(), 'bar': Dingus()}

        self.MyDoc.check_query_sharding(self.spec)

    def should_not_crash(self):
        pass


class WhenShardIndexNotSpecified(BaseDocumentSubclassTest):

    def setup(self):
        BaseDocumentSubclassTest.setup(self)
        self.MyDoc.shard_index = {'fields': ['biz']}
        self.spec = {'foo': Dingus()}

    def should_raise_global_query_exception(self):
        assert_raises(

            GlobalQueryException, self.MyDoc.check_query_sharding, self.spec)