diff --git a/test/unit/data/datatypes/test_h5ad_metadata.py b/test/unit/data/datatypes/test_h5ad_metadata.py index 4ffc4da51420..bfbfa5b31ec2 100644 --- a/test/unit/data/datatypes/test_h5ad_metadata.py +++ b/test/unit/data/datatypes/test_h5ad_metadata.py @@ -10,32 +10,35 @@ def test_h5ad_sniff(): + ann = Anndata() with get_input_files("anndata.h5ad") as input_files: - assert Anndata.sniff(input_files[0]) is True + assert ann.sniff(input_files[0]) is True def test_h5ad_set_meta(): + ann = Anndata() with get_input_files("anndata.h5ad") as input_files: dataset = MockDataset(1) dataset.set_file_name(input_files[0]) - Anndata.set_meta(dataset) + ann.set_meta(dataset) assert dataset.metadata.layers_count == "9" assert dataset.metadata.layers_names == "['X', 'layers', 'obs', 'obsm', 'obsp', 'uns', 'var', 'varm', 'varp']" - assert Anndata.set_meta._layercountsize(dataset) == "['X', 'layers', 'obs', 'obsm', 'obsp', 'uns', 'var', 'varm', 'varp'], 9, 0" + assert ann.set_meta._layercountsize(dataset) == "['X', 'layers', 'obs', 'obsm', 'obsp', 'uns', 'var', 'varm', 'varp'], 9, 0" def test_h5ad_set_peek(): + ann = Anndata() with get_input_files("anndata.h5ad") as input_files: dataset = MockDataset(1) dataset.set_file_name(input_files[0]) - assert Anndata.display_peek(dataset) == "Peek unavailable" + assert ann.display_peek(dataset) == "Peek unavailable" - Anndata.set_meta(dataset) - Anndata.set_peek(dataset) + ann.set_meta(dataset) + ann.set_peek(dataset) assert ( dataset.peek @@ -47,9 +50,7 @@ def test_h5ad_set_peek(): [var]: 1 layer index [obsm]: 0 layer - [varm]: 0 layer - [uns]: 0 layer """ )