Beispiel #1
0
 def test_pixel_at_y_border_raises_index_error(self):
     try:
         # ACT
         calculate_lbp_pattern(self.brightness_matrix, 1, 0)
         self.assertTrue(False, "No error raised")
     except IndexError:
         self.assertTrue(True)
Beispiel #2
0
    def test_width_and_height_are_correct_calculated(self):
        # ACT
        lbp_pattern = calculate_lbp_pattern(self.brightness_matrix, len(self.brightness_matrix[0]) - 2,
                                            len(self.brightness_matrix) - 2)

        # ASSERT
        self.assertTrue(type(lbp_pattern) is list)
Beispiel #3
0
    def test_pattern_matches_expected(self):
        # ACT
        lbp_pattern = calculate_lbp_pattern(self.brightness_matrix, *self.valid_pixel_coordinates)

        # ASSERT
        self.assertEqual(lbp_pattern, self.expected_lbp_pattern_for_pixel_1_1)
Beispiel #4
0
    def test_list_has_size_8(self):
        # ACT
        lbp_pattern = calculate_lbp_pattern(self.brightness_matrix, *self.valid_pixel_coordinates)

        # ASSERT
        self.assertTrue(len(lbp_pattern) is 8)
Beispiel #5
0
    def test_return_type_is_list(self):
        # ACT
        lbp_pattern = calculate_lbp_pattern(self.brightness_matrix, *self.valid_pixel_coordinates)

        # ASSERT
        self.assertTrue(type(lbp_pattern) is list)
Beispiel #6
0
    def test_raises_no_error(self):
        # ACT
        calculate_lbp_pattern(self.brightness_matrix, *self.valid_pixel_coordinates)

        # ASSERT
        self.assertTrue(True)