Skip to content

Commit

Permalink
replace in template
Browse files Browse the repository at this point in the history
  • Loading branch information
andped10 committed Nov 18, 2024
1 parent 7506932 commit 4167271
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/easyreflectometry/summary/html_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<!-- Phases -->
<tr>
<td><h3>Crystal data</h3></td>
<td><h3>Sample</h3></td>
</tr>
<tr></tr>
crystal_data_section
sample_section
<!-- Experiments -->
Expand Down
16 changes: 8 additions & 8 deletions tests/summary/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ def test_compile_html_summary(self, project: Project) -> None:
# When
project._created = True
summary = Summary(project)
summary._project_information_section = MagicMock(return_value='project result')
summary._sample_section = MagicMock(return_value='sample result')
summary._experiments_section = MagicMock(return_value='_experiments results')
summary._refinement_section = MagicMock(return_value='refinement result')
summary._project_information_section = MagicMock(return_value='project result html')
summary._sample_section = MagicMock(return_value='sample result html')
summary._experiments_section = MagicMock(return_value='experiments results html')
summary._refinement_section = MagicMock(return_value='refinement result html')

# Then
result = summary.compile_html_summary()

# Expect
assert (
result
== '<!DOCTYPE html>\n\n<html>\n\n<style>\n th, td {\n padding-right: 18px;\n }\n th {\n text-align: left;\n }\n</style>\n\n<body>\n\n <table>\n\n <tr></tr>\n\n <!-- Summary title -->\n\n <tr>\n <td><h1>Summary</h1></td>\n </tr>\n\n <tr></tr>\n\n <!-- Project -->\n\n project result\n\n <!-- Phases -->\n\n <tr>\n <td><h3>Crystal data</h3></td>\n </tr>\n\n <tr></tr>\n\n crystal_data_section\n\n <!-- Experiments -->\n\n <tr>\n <td><h3>Experiments</h3></td>\n </tr>\n\n <tr></tr>\n\n _experiments results\n\n <!-- Analysis -->\n\n refinement result\n\n </table>\n\n</body>\n\n</html>'
)
assert 'project result html' in result
assert 'sample result html' in result
assert 'experiments results html' in result
assert 'refinement result html' in result

def test_project_information_section(self, project: Project) -> None:
# When
Expand Down

0 comments on commit 4167271

Please sign in to comment.