def test__read_file_not_found(provider_config, provider_name, file_path, file_format): client = Client(dataset_name="output", format=file_format, url=file_path, provider=provider_config(provider_name)) with pytest.raises(FileNotFoundError): next(client.read())
def test__read_from_private_ssh(provider_config, provider_name, file_path, file_format): client = Client(dataset_name="output", format=file_format, url=file_path, provider=provider_config(provider_name)) result = next(client.read()) assert result == { "header1": "text", "header2": 1, "header3": 0.2, "header4": True }
def test__streams_from_ssh_providers(provider_config, provider_name, file_path, file_format): client = Client(dataset_name="output", format=file_format, url=file_path, provider=provider_config(provider_name)) streams = list(client.streams) assert len(streams) == 1 assert streams[0].json_schema["properties"] == { "header1": {"type": "string"}, "header2": {"type": "number"}, "header3": {"type": "number"}, }
def check_read(config, expected_columns=10, expected_rows=42): client = Client(**config) rows = list(client.read()) assert len(rows) == expected_rows assert len(rows[0]) == expected_columns
def test_example_method(): assert Client.dtype_to_json_type("bool") == "boolean"