def test_get_potential_hits(self):
        execution1 = MagicMock()
        execution1.potential_hits = [{
            "rank": 0,
            "name": "finding1"
        }, {
            "rank": 1,
            "name": "finding2"
        }]
        execution2 = MagicMock()
        execution2.potential_hits = [{"rank": 0, "name": "finding3"}]
        run = Run([execution1, execution2])

        potential_hits = run.get_potential_hits()

        assert_equals(potential_hits, [{
            "rank": 0,
            "name": "finding1"
        }, {
            "rank": 1,
            "name": "finding2"
        }, {
            "rank": 2,
            "name": "finding3"
        }])
Beispiel #2
0
    def test_get_potential_hits(self):
        execution1 = MagicMock()
        execution1.potential_hits = ["finding1", "finding2"]
        execution2 = MagicMock()
        execution2.potential_hits = ["finding3"]
        run = Run([execution1, execution2])

        potential_hits = run.get_potential_hits()

        assert_equals(potential_hits, ["finding1", "finding2", "finding3"])
Beispiel #3
0
    def test_get_potential_hits_preserves_rank(self):
        execution = MagicMock()
        execution.potential_hits = [{"rank": 42, "name": "f1"}, {"rank": 1337, "name": "f2"}]
        run = Run([execution])

        potential_hits = run.get_potential_hits()

        assert_equals(potential_hits, [
            {"rank": 42, "name": "f1"},
            {"rank": 1337, "name": "f2"}
        ])