mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-02 00:38:12 +08:00
#22 blackened code
This commit is contained in:
+32
-29
@@ -2,45 +2,48 @@ import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from cellxgene_gateway.filecrawl import render_entry
|
||||
|
||||
|
||||
class TestRenderEntry(unittest.TestCase):
|
||||
def test_GIVEN_path_both_slash_THEN_view_has_single_slash(self):
|
||||
entry = {
|
||||
"path": "/somepath/",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
"path": "/somepath/",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
rendered = render_entry(entry)
|
||||
self.assertIn('view/somepath', rendered)
|
||||
self.assertIn("view/somepath", rendered)
|
||||
|
||||
def test_GIVEN_path_starts_slash_THEN_view_has_single_slash(self):
|
||||
entry = {
|
||||
"path": "/somepath",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
"path": "/somepath",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
rendered = render_entry(entry)
|
||||
self.assertIn('view/somepath', rendered)
|
||||
self.assertIn("view/somepath", rendered)
|
||||
|
||||
def test_GIVEN_path_ends_slash_THEN_view_has_single_slash(self):
|
||||
entry = {
|
||||
"path": "somepath/",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
"path": "somepath/",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
rendered = render_entry(entry)
|
||||
self.assertIn('view/somepath', rendered)
|
||||
self.assertIn("view/somepath", rendered)
|
||||
|
||||
def test_GIVEN_path_no_slash_THEN_view_has_single_slash(self):
|
||||
entry = {
|
||||
"path": "somepath",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
"path": "somepath",
|
||||
"name": "entry",
|
||||
"type": "file",
|
||||
"annotations": [],
|
||||
"children": [],
|
||||
}
|
||||
rendered = render_entry(entry)
|
||||
self.assertIn('view/somepath', rendered)
|
||||
|
||||
self.assertIn("view/somepath", rendered)
|
||||
|
||||
Reference in New Issue
Block a user