def from_url(cls, url, **kwargs): """Create a `ImageStream` from a url. This will create a `ImageStream` from an Image using its url Parameters ---------- url: str The url of the file that will be used for the .image trait. **kwargs: Extra keyword arguments for `ImageStream` Returns an `ImageStream`. """ return cls(image=Image.from_url(url), **kwargs)
def test_from_url_bytes(): img = Image.from_url(b'https://jupyter.org/assets/main-logo.svg') assert img.value == b'https://jupyter.org/assets/main-logo.svg'
def test_value_repr_url(): img = Image.from_url(b'https://jupyter.org/assets/main-logo.svg') assert 'https://jupyter.org/assets/main-logo.svg' in img.__repr__()
def test_from_url_bytes(): img = Image.from_url(b'https://jupyter.org/assets/main-logo.svg') assert img.value == b'https://jupyter.org/assets/main-logo.svg'
def test_value_repr_url(): img = Image.from_url(b'https://jupyter.org/assets/main-logo.svg') assert 'https://jupyter.org/assets/main-logo.svg' in img.__repr__()