#22 blackened code

This commit is contained in:
Alok Saldanha
2020-08-10 17:56:32 -04:00
parent 63cdfe1953
commit bfa80f7ef8
15 changed files with 295 additions and 151 deletions
+32 -29
View File
@@ -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)