Ejemplo n.º 1
0
    def test_get_multiple(self):
        models.BugAssociation.objects.create(
            bug_id='999999',
            signature='OOM | small'
        )
        models.BugAssociation.objects.create(
            bug_id='1000000',
            signature='OOM | large'
        )

        api = models.SignaturesByBugs()

        resp = api.get(bug_ids=['999999', '1000000'])
        assert resp == {
            'hits': [
                {
                    'id': 999999,
                    'signature': 'OOM | small'
                },
                {
                    'id': 1000000,
                    'signature': 'OOM | large'
                }
            ],
            'total': 2
        }
Ejemplo n.º 2
0
    def test_get_one(self):
        models.BugAssociation.objects.create(bug_id="999999", signature="OOM | small")

        api = models.SignaturesByBugs()

        resp = api.get(bug_ids=["999999"])
        assert resp == {
            "hits": [{"id": 999999, "signature": "OOM | small"}],
            "total": 1,
        }
Ejemplo n.º 3
0
    def test_get_multiple(self):
        models.BugAssociation.objects.create(bug_id="999999", signature="OOM | small")
        models.BugAssociation.objects.create(bug_id="1000000", signature="OOM | large")

        api = models.SignaturesByBugs()

        resp = api.get(bug_ids=["999999", "1000000"])
        assert resp == {
            "hits": [
                {"id": 999999, "signature": "OOM | small"},
                {"id": 1000000, "signature": "OOM | large"},
            ],
            "total": 2,
        }