holmes-app / holmes-api

API for holmes website validation.
MIT License
17 stars 7 forks source link

Fix FAIL: test_can_get_group_by_value_for_key #133

Closed scorphus closed 9 years ago

scorphus commented 9 years ago
======================================================================
FAIL: test_can_get_group_by_value_for_key (tests.unit.models.test_violations.TestViolations)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/holmes-app/holmes-api/tests/unit/models/test_violations.py", line 155, in test_can_get_group_by_value_for_key
    expect(violations).to_be_like([('random.value.2', 3)])
  File "/home/travis/virtualenv/python2.7.6/lib/python2.7/site-packages/preggy/core.py", line 229, in _assert_topic
    return _registered_assertions[method_name](self.topic, *args, **kw)
  File "/home/travis/virtualenv/python2.7.6/lib/python2.7/site-packages/preggy/core.py", line 59, in wrapper
    return func(*args, **kw)
  File "/home/travis/virtualenv/python2.7.6/lib/python2.7/site-packages/preggy/assertions/like.py", line 216, in to_be_like
    raise AssertionError("Expected topic('{topic}') to be like '{expected}'".format(topic=topic, expected=expected))
AssertionError: Expected topic('[(u'random.value.2', 2L), (u'random.value.2', 1L)]') to be like '[('random.value.2', 3)]'
scorphus commented 9 years ago

Either (1) stop grouping by value (for it is a binary content and does not always match) or (2) manage to get the gzipper to generate identical binary contents from identical JSON strings.