Skip to content

Commit

Permalink
Removethe project name in the CSV outputs #45
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Nov 17, 2020
1 parent 8a4bfd4 commit 35e09e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scanpipe/pipes/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def queryset_to_csv(project, queryset, fieldnames):
The output file is created in the `project` output/ directory.
"""
model_name = queryset.model._meta.model_name
output_file = project.get_output_file_path(f"{project.name}_{model_name}", "csv")
output_file = project.get_output_file_path(f"{model_name}", "csv")

with open(output_file, "w") as csvfile:
writer = csv.DictWriter(csvfile, fieldnames)
Expand Down
4 changes: 2 additions & 2 deletions scanpipe/tests/test_pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def test_scanpipe_pipes_outputs_to_csv(self):
project1 = Project.objects.create(name="Analysis")
outputs.to_csv(project=project1)
expected = [
"Analysis_codebaseresource-2010-10-10-10-10-10.csv",
"Analysis_discoveredpackage-2010-10-10-10-10-10.csv",
"codebaseresource-2010-10-10-10-10-10.csv",
"discoveredpackage-2010-10-10-10-10-10.csv",
]
self.assertEqual(sorted(expected), sorted(project1.output_root))

Expand Down

0 comments on commit 35e09e4

Please sign in to comment.