mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-09 07:18:11 +08:00
Adjust test case for dirs with h5ad
This commit is contained in:
@@ -57,9 +57,16 @@ class TestRenderItemTree(unittest.TestCase):
|
|||||||
@patch("cellxgene_gateway.items.file.fileitem_source.FileItemSource")
|
@patch("cellxgene_gateway.items.file.fileitem_source.FileItemSource")
|
||||||
def test_GIVEN_deep_nested_dirs_THEN_includes_dirs_in_output(self, item_source):
|
def test_GIVEN_deep_nested_dirs_THEN_includes_dirs_in_output(self, item_source):
|
||||||
item_source.name = "FakeSource"
|
item_source.name = "FakeSource"
|
||||||
item_tree = ItemTree("foo/bar/baz", [], [])
|
item_source.get_annotations_subpath = lambda _: "FakeAnnotations"
|
||||||
|
file_item = FileItem(
|
||||||
|
subpath="foo/bar/baz", name="file.h5ad", type=ItemType.h5ad
|
||||||
|
)
|
||||||
|
item_tree = ItemTree("foo/bar/baz", [file_item], [])
|
||||||
rendered = render_item_tree(item_tree, item_source)
|
rendered = render_item_tree(item_tree, item_source)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
rendered,
|
rendered,
|
||||||
"<li><a href='/filecrawl/foo/bar/baz?source=FakeSource'>baz</a><ul></ul></li>",
|
"<li><a href='/filecrawl/foo/bar/baz?source=FakeSource'>baz</a><ul>"
|
||||||
|
"<li> <a href='/source/FakeSource/view/foo/bar/baz/file.h5ad/'>file.h5ad</a>"
|
||||||
|
" | annotations: <a class='new' href='/source/FakeSource/view/FakeAnnotations'>new</a>"
|
||||||
|
"</li></ul></li>",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user