thermography.test package

This package contains the unittests related to the utility functions of thermography.

Submodules

thermography.test.test_ID module

class TestIDUtils(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_ID_generator()[source]

Tests the values of the IDs generated by next_id() and reset_id().

thermography.test.test_geometry module

This module implements the tests of the functions in geometry package.

class TestGeometryUtils(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

assertListAlmostEqual(first, second, places=None, msg=None)[source]

Tests whether the elements of two lists are almost equal.

Parameters:
  • first – The first list to compare.
  • second – The second list to compare.
  • places – Decimal places to be checked for comparison.
  • msg – Optional error message in case comparison failure.
Returns:

True if the two lists passed as argument are almost equal, False otherwise.

test_angle_difference()[source]

Tests the angle_diff() function which computes the angle difference between two segments.

test_area()[source]

Tests the area() function which computes the surface enclosed by a set of points.

test_area_between_rectangles()[source]

Tests the area_between_rectangles() function which computes the surface between two rectangles.

test_aspect_ratio()[source]

Tests the aspect_ratio() function which computes the aspect ratio of a rectangle.

test_line_estimate()[source]

Tests the line_estimate() function which computes a line estimate from two segments.

test_mean_segment_angle()[source]

Tests the mean_segment_angle() function which computes the mean angle from a set of segments.

test_merge_segments()[source]

Tests the merge_segments() function which merges two segments into a single segment.

test_point_line_distance()[source]

Tests the point_line_distance() function which computes the distance between a point and a line.

test_rectangle_contains()[source]

Tests the rectangle_contains() function which computes whether a point is contained by a rectangle or not.

test_segment_angle()[source]

Tests the angle() function which computes the angle for a segment.

test_segment_line_intersection()[source]

Tests the segment_line_intersection() function which computes the intersection point between a segment and a line.

test_segment_min_distance()[source]

Tests the segment_min_distance() function which computes the minimal distance between two segments.

test_segment_segment_intersection()[source]

Tests the segment_segment_intersection() function which computes the intersection point between two segments.

test_segment_sorting()[source]

Tests the sort_segments() function which sorts a set of almost collinear segments based on their mean normal direction.

test_segments_collinear()[source]

Tests the segments_collinear() function which computes whether two segments are almost collinear or not.

test_sort_rectangle()[source]

Tests the sort_rectangle() function which sorts the vertices composing a rectangle into a canonical order.

thermography.test.test_images module

This module implements the tests of the functions in geometry package.

class TestImageUtils(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Initializes the common elements for the tests.

test_scale_image_gray()[source]

Tests the shape of the input gray_scale image after being scaled.

test_scale_image_gray_identity()[source]

Tests the shape of the input gray_scale image after being scaled by the identity.

test_scale_image_rgb()[source]

Tests the shape of the input rgb image after being scaled.

test_scale_image_rgb_identity()[source]

Tests the shape of the input rgb image after being scaled by the identity.