Skip to content

Commit

Permalink
cleanup: test_datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna committed Jan 30, 2024
1 parent e40cae2 commit 38013d2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Any

import pytest
from requests import ConnectionError

Expand All @@ -22,16 +20,13 @@ def test_dataset_constructor() -> None:
Datasets(db, metadata_file=bad_metadata_url)


def test_list_datasets(capfd: Any) -> None:
def test_list_datasets() -> None:
datasets = Datasets(db, metadata_file=test_metadata_url).list_datasets()
assert type(datasets) is list
assert "TEST" in datasets

out, _ = capfd.readouterr()
assert "TEST" in out


def test_dataset_info(capfd: Any) -> None:
def test_dataset_info() -> None:
with pytest.raises(ValueError):
Datasets(db).dataset_info("invalid")

Expand All @@ -45,9 +40,6 @@ def test_dataset_info(capfd: Any) -> None:
assert type(dataset) is dict
assert dataset["file_type"] == "jsonl"

out, _ = capfd.readouterr()
assert len(out.replace("\n", "")) > 0


def test_load_json() -> None:
cleanup_collections()
Expand Down

0 comments on commit 38013d2

Please sign in to comment.