()
| 46 | |
| 47 | |
| 48 | def test_get(): |
| 49 | mock_view = MockView() |
| 50 | # Test with existing view |
| 51 | with mock.patch("mitmproxy.contentviews.registry", {"mock": mock_view}): |
| 52 | with pytest.deprecated_call(): |
| 53 | view = _compat.get("mock") |
| 54 | assert view == mock_view |
| 55 | |
| 56 | # Test with non-existent view |
| 57 | with mock.patch("mitmproxy.contentviews.registry", {}): |
| 58 | with pytest.deprecated_call(): |
| 59 | view = _compat.get("nonexistent") |
| 60 | assert view is None |
| 61 | |
| 62 | |
| 63 | def test_remove(): |