Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fact_pdf_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
fact_pdf_report
Commits
ba94a0ba
Commit
ba94a0ba
authored
Jul 27, 2020
by
Jörg Stucke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whitespace bugfix
parent
5d77c76b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
template_engine.py
pdf_generator/tex_generation/template_engine.py
+3
-3
test_template_engine.py
test/unit/tex_generation/test_template_engine.py
+13
-1
No files found.
pdf_generator/tex_generation/template_engine.py
View file @
ba94a0ba
...
...
@@ -133,10 +133,10 @@ def _count_this_mitigation(summary, mitigation):
def
software_components
(
software_string
):
software
=
software_string
software
=
software_string
.
strip
()
ver_number
=
''
if
' '
in
software
_string
:
split_software_string
=
software
_string
.
split
(
' '
)
if
' '
in
software
:
split_software_string
=
software
.
split
(
' '
)
if
len
(
split_software_string
)
>
2
:
software
,
ver_number
=
_larger_two_components
(
split_software_string
)
elif
len
(
split_software_string
[
1
])
>
0
:
...
...
test/unit/tex_generation/test_template_engine.py
View file @
ba94a0ba
...
...
@@ -2,7 +2,7 @@ from pathlib import Path
import
pytest
from
pdf_generator.tex_generation.template_engine
import
(
TemplateEngine
,
decode_base64_to_file
,
render_number_as_size
,
render_unix_time
,
software_components
,
TemplateEngine
,
decode_base64_to_file
,
render_number_as_size
,
render_unix_time
,
replace_special_characters
,
get_five_longest_entries
)
...
...
@@ -56,3 +56,15 @@ def test_get_five_longest_entries():
longest_dict
=
get_five_longest_entries
(
TEST_DICT
[
'file_type'
][
'summary'
],
top
=
1
)
assert
len
(
longest_dict
)
==
1
assert
'compression/zlib'
in
longest_dict
.
keys
()
@pytest.mark.parametrize
(
'test_input, expected_output'
,
[
(
'FOO 1.0'
,
'1.0}{FOO'
),
(
'1.0 FOO'
,
'1.0}{FOO'
),
(
'FOO BAR 1.0'
,
'1.0}{FOOBAR'
),
(
'FOO'
,
'}{FOO'
),
(
' FOO '
,
'}{FOO'
),
(
' FOO BAR 1.0 '
,
'1.0}{FOOBAR'
),
])
def
test_software_components
(
test_input
,
expected_output
):
assert
software_components
(
test_input
)
==
expected_output
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment