Browse Source

fix(py3): Fix tests in test_organization_events_facets (#20832)

Main failure here was `TypeError: '<' not supported between instances of 'dict' and 'dict'`. We need
to be explicit when sorting dicts now, so I just used the `name` key which seems to be unique
for each dict.
Dan Fuller 4 years ago
parent
commit
f235d607b2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tests/snuba/api/endpoints/test_organization_events_facets.py

+ 2 - 1
tests/snuba/api/endpoints/test_organization_events_facets.py

@@ -37,7 +37,8 @@ class OrganizationEventsFacetsEndpointTest(SnubaTestCase, APITestCase):
                 break
         assert actual is not None, "Could not find {} facet in {}".format(key, response.data)
         assert "topValues" in actual
-        assert sorted(expected) == sorted(actual["topValues"])
+        key = lambda row: row["name"] if row["name"] is not None else ""
+        assert sorted(expected, key=key) == sorted(actual["topValues"], key=key)
 
     def test_performance_view_feature(self):
         with self.feature(