Mongoengine测试失败(2个错误和2个失败)

时间:2014-06-17 06:56:40

标签: python mongoengine

我有python 2.7和mongoengine 0.8.7 当我在我的Mac机器上运行mongoengine测试时,得到以下2个错误和2个失败

======================================================================
ERROR: test_2dsphere_point (tests.GeoQueriesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/pavang/Projects/github/mongoengine/tests/queryset/geo.py", line 238, in test_2dsphere_point
    self.assertEqual(events.count(), 1)
  File "mongoengine/queryset/queryset.py", line 108, in count
    self._len = super(QuerySet, self).count(with_limit_and_skip)
  File "mongoengine/queryset/base.py", line 339, in count
    return self._cursor.count(with_limit_and_skip=with_limit_and_skip)
  File "/Library/Python/2.7/site-packages/pymongo/cursor.py", line 747, in count
    **command)
  File "/Library/Python/2.7/site-packages/pymongo/database.py", line 435, in command
    uuid_subtype, compile_re, **kwargs)[0]
  File "/Library/Python/2.7/site-packages/pymongo/database.py", line 341, in _command
    msg, allowable_errors)
  File "/Library/Python/2.7/site-packages/pymongo/helpers.py", line 178, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
OperationFailure: command SON([('count', u'event'), ('fields', None), ('query', {'location': SON([('$near', {'$geometry': {'type': 'Point', 'coordinates': [-122.415579, 37.7566023]}}), ('$maxDistance', 10000)])})]) failed: exception: geo near accepts just one argument when querying for a GeoJSON point. Extra field found: $maxDistance: 10000

======================================================================
ERROR: test_spherical_geospatial_operators (tests.GeoQueriesTest)
Ensure that spherical geospatial queries are working
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/pavang/Projects/github/mongoengine/tests/queryset/geo.py", line 174, in test_spherical_geospatial_operators
    self.assertEqual(points[1].id, south_point.id)
  File "mongoengine/queryset/base.py", line 150, in __getitem__
    return queryset._document._from_son(queryset._cursor[key],
  File "/Library/Python/2.7/site-packages/pymongo/cursor.py", line 588, in __getitem__
    raise IndexError("no such item for Cursor instance")
IndexError: no such item for Cursor instance

======================================================================
FAIL: test_capped_collection (tests.InstanceTest)
Ensure that capped collections work properly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/pavang/Projects/github/mongoengine/tests/document/instance.py", line 78, in test_capped_collection
    self.assertEqual(options['size'], 90000)
AssertionError: 90112 != 90000
    '90112 != 90000' = '%s != %s' % (safe_repr(90112), safe_repr(90000))
    '90112 != 90000' = self._formatMessage('90112 != 90000', '90112 != 90000')
>>  raise self.failureException('90112 != 90000')


======================================================================
FAIL: test_bulk_insert (tests.QuerySetTest)
Ensure that bulk insert works
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/pavang/Projects/github/mongoengine/tests/queryset/queryset.py", line 653, in test_bulk_insert
    self.assertEqual(q, 1)  # 1 for the insert
AssertionError: 99 != 1
    '99 != 1' = '%s != %s' % (safe_repr(100), safe_repr(1))
    '99 != 1' = self._formatMessage('99 != 1', '99 != 1')
>>  raise self.failureException('99 != 1')

在7.836s中进行600次测试

失败(失败= 2,错误= 2)

我做错了什么?

0 个答案:

没有答案