Exemple #1
0
    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)
Exemple #2
0
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'
Exemple #3
0
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'
Exemple #5
0
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__()