MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_url

Function test_url

lib/matplotlib/tests/test_backend_svg.py:340–361  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338
339
340def test_url():
341 # Test that object url appears in output svg.
342
343 fig, ax = plt.subplots()
344
345 # collections
346 s = ax.scatter([1, 2, 3], [4, 5, 6])
347 s.set_urls(['https://example.com/foo', 'https://example.com/bar', None])
348
349 # Line2D
350 p, = plt.plot([2, 3, 4], [4, 5, 6])
351 p.set_url('https://example.com/baz')
352
353 # Line2D markers-only
354 p, = plt.plot([3, 4, 5], [4, 5, 6], linestyle='none', marker='x')
355 p.set_url('https://example.com/quux')
356
357 b = BytesIO()
358 fig.savefig(b, format='svg')
359 b = b.getvalue()
360 for v in [b'foo', b'bar', b'baz', b'quux']:
361 assert b'https://example.com/' + v in b
362
363
364def test_url_tick(monkeypatch):

Callers

nothing calls this directly

Calls 6

set_urlsMethod · 0.80
subplotsMethod · 0.45
scatterMethod · 0.45
plotMethod · 0.45
set_urlMethod · 0.45
savefigMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…