예제 #1
0
def test_save():
    # Arrange
    with Image.open(TEST_FILE) as im:
        dummy_fp = None
        dummy_filename = "dummy.filename"

        # Act / Assert: stub cannot save without an implemented handler
        with pytest.raises(OSError):
            im.save(dummy_filename)
        with pytest.raises(OSError):
            Hdf5StubImagePlugin._save(im, dummy_fp, dummy_filename)
예제 #2
0
    def test_save(self):
        # Arrange
        im = Image.open(TEST_FILE)
        dummy_fp = None
        dummy_filename = "dummy.filename"

        # Act / Assert: stub cannot save without an implemented handler
        self.assertRaises(IOError, lambda: im.save(dummy_filename))
        self.assertRaises(
            IOError,
            lambda: Hdf5StubImagePlugin._save(im, dummy_fp, dummy_filename))
예제 #3
0
    def test_save(self):
        # Arrange
        im = Image.open(TEST_FILE)
        dummy_fp = None
        dummy_filename = "dummy.filename"

        # Act / Assert: stub cannot save without an implemented handler
        self.assertRaises(IOError, lambda: im.save(dummy_filename))
        self.assertRaises(
            IOError,
            lambda: Hdf5StubImagePlugin._save(im, dummy_fp, dummy_filename))