aboutsummaryrefslogtreecommitdiff
path: root/tests/incite/collections/test_df_collection_thl_web.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/incite/collections/test_df_collection_thl_web.py')
-rw-r--r--tests/incite/collections/test_df_collection_thl_web.py120
1 files changed, 89 insertions, 31 deletions
diff --git a/tests/incite/collections/test_df_collection_thl_web.py b/tests/incite/collections/test_df_collection_thl_web.py
index bcdeb83..6d509bc 100644
--- a/tests/incite/collections/test_df_collection_thl_web.py
+++ b/tests/incite/collections/test_df_collection_thl_web.py
@@ -3,19 +3,16 @@ from __future__ import annotations
from collections.abc import Generator
from datetime import datetime
from itertools import product
-from typing import TYPE_CHECKING
import dask.dataframe as dd
import pandas as pd
import pytest
from pandera.pandas import DataFrameSchema
-from generalresearch.incite.collections import DFCollection, DFCollectionType
-
-if TYPE_CHECKING:
- from generalresearch.incite.collections import (
- DFCollectionType,
- )
+from generalresearch.incite.collections import (
+ DFCollection,
+ DFCollectionType,
+)
def combo_object() -> Generator[tuple]:
@@ -39,7 +36,10 @@ def combo_object() -> Generator[tuple]:
class TestDFCollection_thl_web:
def test_init(
- self, df_collection_data_type: DFCollectionType, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
assert isinstance(df_collection_data_type, DFCollectionType)
assert isinstance(df_collection, DFCollection)
@@ -50,12 +50,12 @@ class TestDFCollection_thl_web:
)
class TestDFCollection_thl_web_Properties:
- def test_items(self, df_collection):
+ def test_items(self, df_collection: DFCollection):
assert isinstance(df_collection.items, list)
for i in df_collection.items:
assert i._collection == df_collection
- def test__schema(self, df_collection):
+ def test__schema(self, df_collection: DFCollection):
assert isinstance(df_collection._schema, DataFrameSchema)
@@ -65,16 +65,16 @@ class TestDFCollection_thl_web_Properties:
class TestDFCollection_thl_web_BaseProperties:
@pytest.mark.skip
- def test__interval_range(self, df_collection):
+ def test__interval_range(self, df_collection: DFCollection):
pass
- def test_interval_start(self, df_collection):
+ def test_interval_start(self, df_collection: DFCollection):
assert isinstance(df_collection.interval_start, datetime)
- def test_interval_range(self, df_collection):
+ def test_interval_range(self, df_collection: DFCollection):
assert isinstance(df_collection.interval_range, list)
- def test_progress(self, df_collection):
+ def test_progress(self, df_collection: DFCollection):
assert isinstance(df_collection.progress, pd.DataFrame)
@@ -84,17 +84,21 @@ class TestDFCollection_thl_web_BaseProperties:
class TestDFCollection_thl_web_Methods:
@pytest.mark.skip
- def test_initial_loads(self, df_collection_data_type, df_collection, offset):
+ def test_initial_loads(
+ self, df_collection_data_type, df_collection: DFCollection, offset: str
+ ):
pass
@pytest.mark.skip
def test_fetch_force_rr_latest(
- self, df_collection_data_type, df_collection, offset: str
+ self, df_collection_data_type, df_collection: DFCollection, offset: str
):
pass
@pytest.mark.skip
- def test_force_rr_latest(self, df_collection_data_type, df_collection, offset):
+ def test_force_rr_latest(
+ self, df_collection_data_type, df_collection: DFCollection, offset: str
+ ):
pass
@@ -103,63 +107,108 @@ class TestDFCollection_thl_web_Methods:
)
class TestDFCollection_thl_web_BaseMethods:
- def test_fetch_all_paths(self, df_collection_data_type, offset: str, df_collection):
+ def test_fetch_all_paths(
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
+ ):
res = df_collection.fetch_all_paths(
items=None, force_rr_latest=False, include_partial=False
)
assert isinstance(res, list)
@pytest.mark.skip
- def test_ddf(self, df_collection_data_type, offset: str, df_collection):
+ def test_ddf(
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
+ ):
res = df_collection.ddf()
assert isinstance(res, dd.DataFrame)
# -- cleanup --
@pytest.mark.skip
def test_schedule_cleanup(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
@pytest.mark.skip
- def test_cleanup(self, df_collection_data_type, offset: str, df_collection):
+ def test_cleanup(
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
+ ):
pass
@pytest.mark.skip
def test_cleanup_partials(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
@pytest.mark.skip
def test_clear_tmp_archives(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
@pytest.mark.skip
def test_clear_corrupt_archives(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
@pytest.mark.skip
def test_rebuild_symlinks(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
# -- Source timing --
@pytest.mark.skip
- def test_get_item(self, df_collection_data_type, offset: str, df_collection):
+ def test_get_item(
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
+ ):
pass
@pytest.mark.skip
- def test_get_item_start(self, df_collection_data_type, offset: str, df_collection):
+ def test_get_item_start(
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
+ ):
pass
@pytest.mark.skip
- def test_get_items(self, df_collection_data_type, offset: str, df_collection):
+ def test_get_items(
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
+ ):
# If we get all the items from the start of the collection, it
# should include all the items!
res1 = df_collection.items
@@ -168,18 +217,27 @@ class TestDFCollection_thl_web_BaseMethods:
@pytest.mark.skip
def test_get_items_from_year(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
@pytest.mark.skip
def test_get_items_last90(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass
@pytest.mark.skip
def test_get_items_last365(
- self, df_collection_data_type, offset: str, df_collection
+ self,
+ df_collection_data_type: DFCollectionType,
+ offset: str,
+ df_collection: DFCollection,
):
pass