def test_match_add_with_type(self):
        """Tests that unknown observables are added."""
        response = client.post(
            "/api/v2/graph/match",
            json={
                "observables": ["randomgenericobservable"],
                "add_unknown": True,
                "add_type": "generic",
            },
        )
        self.assertEqual(response.status_code, 200)
        data = response.json()

        # Observable is known, has been added.
        self.assertEqual(len(data["known"]), 1, data)
        self.assertEqual(data["known"][0]["value"], "randomgenericobservable")
        self.assertEqual(data["known"][0]["type"], "generic")
Tests that unknown observables are added.
tests/apiv2/graph.py