Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
githubering182 committed Jul 16, 2024
1 parent e6c63c8 commit 4ad46c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions backend-app/file/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CSV(Export):
def _write_attribute(self, dest: BytesIO, data: ROW):
name = data.get("name")
level_name = data.get("levelName")
children = data.get("children", [])

val = self.t_val(data.get("v", {}))
acc = self.t_val(data.get("a", {}))
Expand All @@ -59,7 +60,7 @@ def _write_attribute(self, dest: BytesIO, data: ROW):
encoding=ENCODING
))

for child in (children := data.get("children", [])): self._write_attribute(dest, child)
for child in children: self._write_attribute(dest, child)

def _write_user(self, dest: BytesIO, data: ROW):
name = data.get("name")
Expand Down Expand Up @@ -106,6 +107,7 @@ def _row_n(self, new: int): self.__row_n = new
def _write_attribute(self, dest: Worksheet, data: ROW):
name = data.get("name")
level_name = data.get("levelName")
children = data.get("children", [])

val = self.t_val(data.get("v", {}))
acc = self.t_val(data.get("a", {}))
Expand All @@ -117,7 +119,7 @@ def _write_attribute(self, dest: Worksheet, data: ROW):
for i, item in enumerate(row): dest.write(self._row_n, i, item)
self._row_n += 1

for child in (children := data.get("children", [])): self._write_attribute(dest, child)
for child in children: self._write_attribute(dest, child)

def _write_user(self, dest: Worksheet, data: ROW):
name = data.get("name")
Expand Down
4 changes: 2 additions & 2 deletions backend-app/file/file_tests/export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def setUpClass(cls):
cls.user_stat, _ = StatsServices.from_user(cls.case.project.id)

def test_xls(self):
attr_res = XLS(self.attr_stat, "attribute").into_response()
user_res = XLS(self.user_stat, "user").into_response()
#attr_res = XLS(self.attr_stat, "attribute").into_response()
#user_res = XLS(self.user_stat, "user").into_response()
# TODO:

def test_csv(self):
Expand Down
2 changes: 1 addition & 1 deletion backend-app/file/file_tests/services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def setUpClass(cls):
def test_export(self):
self._assert_query_fail({})
self._assert_query_fail({"type": 1})
self._assert_query_fail({"type": 1, "project_id": 1,})
self._assert_query_fail({"type": 1, "project_id": 1})
self._assert_query_fail({"type": "json", "project_id": 1, "choice": "user"}, True)

try:
Expand Down

0 comments on commit 4ad46c5

Please sign in to comment.