Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_plot_fails_if_not_analysed(self):
fs = FlatSym.from_demo_image()
with self.assertRaises(NotAnalyzed):
fs.plot_analyzed_image()
def create_instance():
fs = FlatSym.from_demo_image()
fs.analyze('varian', 'varian')
return fs
def test_pdf_fails_if_not_analyzed(self):
fs = FlatSym.from_demo_image()
with self.assertRaises(NotAnalyzed):
fs.publish_pdf('dummy.pdf')
def test_symmetry_methods(self):
fs = FlatSym.from_demo_image()
analyze = partial(fs.analyze, flatness_method='varian')
for method in ('point difference', 'elekta', 'pdq iec'):
analyze(symmetry_method=method) # shouldn't raise
def test_profile_limits(self):
"""Extreme profile limits should not raise an error"""
fs = FlatSym.from_demo_image()
fs.analyze(flatness_method="varian", symmetry_method="varian", vert_position=0.5, horiz_position=0.5, vert_width=0, horiz_width=0)
fs.analyze(flatness_method="varian", symmetry_method="varian", vert_position=0.0, horiz_position=0.0, vert_width=1, horiz_width=1)
fs.analyze(flatness_method="varian", symmetry_method="varian", vert_position=1.0, horiz_position=1.0, vert_width=1, horiz_width=1)
def test_results_fails_if_not_analyzed(self):
fs = FlatSym.from_demo_image()
with self.assertRaises(NotAnalyzed):
fs.results()