示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#6
0
    def test_raises_no_error(self):
        # ACT
        calculate_lbp_pattern(self.brightness_matrix, *self.valid_pixel_coordinates)

        # ASSERT
        self.assertTrue(True)