def test_unpublish_multiple_datasets_sync(client): x = delayed(inc)(1) y = delayed(inc)(2) client.publish_dataset(x=x, y=y) client.unpublish_dataset(name="x") with pytest.raises(KeyError) as exc_info: client.get_dataset(name="x") datasets = client.list_datasets() assert set(datasets) == {"y"} assert "not found" in str(exc_info.value) assert "x" in str(exc_info.value) client.unpublish_dataset(name="y") with pytest.raises(KeyError) as exc_info: client.get_dataset(name="y") assert "not found" in str(exc_info.value) assert "y" in str(exc_info.value)
def test_unpublish_multiple_datasets_sync(client): x = delayed(inc)(1) y = delayed(inc)(2) client.publish_dataset(x=x, y=y) client.unpublish_dataset(name='x') with pytest.raises(KeyError) as exc_info: result = client.get_dataset(name='x') datasets = client.list_datasets() assert set(datasets) == {'y'} assert "not found" in str(exc_info.value) assert "x" in str(exc_info.value) client.unpublish_dataset(name='y') with pytest.raises(KeyError) as exc_info: result = client.get_dataset(name='y') assert "not found" in str(exc_info.value) assert "y" in str(exc_info.value)
def test_datasets_delitem(client): for key in ["key", ("key", "key"), 1]: value = "value" client.publish_dataset(value, name=key) del client.datasets[key] assert key not in client.list_datasets()
def test_datasets_delitem(client): for key in ['key', ('key', 'key'), 1]: value = 'value' client.publish_dataset(value, name=key) del client.datasets[key] assert key not in client.list_datasets()