Beispiel #1
0
def test_config_serialization():
    # Use context manager without changing the value to ensure test side effects are restored
    with dask.config.set({"array.svg.size": dask.config.get("array.svg.size")}):

        # Take a round trip through the serialization
        serialized = serialize({"array": {"svg": {"size": 150}}})
        config = deserialize(serialized)

        dask.config.update(dask.config.global_config, config)
        assert dask.config.get("array.svg.size") == 150
Beispiel #2
0
def test_config_inheritance():
    config = collect_env({
        "DASK_INTERNAL_INHERIT_CONFIG":
        serialize({"array": {
            "svg": {
                "size": 150
            }
        }})
    })
    assert dask.config.get("array.svg.size", config=config) == 150
Beispiel #3
0
def TestOneInput(data):
  fdp = atheris.FuzzedDataProvider(data)
  try:
    fuzzed_dict = json.loads(fdp.ConsumeString(sys.maxsize))
  except json.JSONDecodeError:
    return

  if type(fuzzed_dict) is not dict:
    return
  serialized = serialize(fuzzed_dict)
  config = deserialize(serialized)