コード例 #1
0
    def test_should_capture_frame_for_section_returns_true_and_current_index_given_change_detected(self):
        encoder = Encoder(threshold=450, null_zone=50)
        should_capture, idx = encoder.should_capture_frame_for_section(self.whiteimage)

        self.assertTrue(should_capture)
        should_capture, idx = encoder.should_capture_frame_for_section(self.whiteimage)
        self.assertFalse(should_capture)
コード例 #2
0
    def test_should_capture_frame_for_section_should_reset_to_zero_if_number_of_sections_exceeds_total_sections(self):
        encoder = Encoder(threshold=450, null_zone=50, sections=2)
        encoder.should_capture_frame_for_section(self.blackimage)
        encoder.should_capture_frame_for_section(self.whiteimage)
        retVal, rotation = encoder.should_capture_frame_for_section(self.blackimage)

        self.assertTrue(retVal)
        self.assertEqual(0, rotation)
コード例 #3
0
ファイル: test_encoder.py プロジェクト: kyapp69/peachyscanner
    def test_should_capture_frame_for_section_should_reset_to_zero_if_number_of_sections_exceeds_total_sections(
            self):
        encoder = Encoder(threshold=450, null_zone=50, sections=2)
        encoder.should_capture_frame_for_section(self.blackimage)
        encoder.should_capture_frame_for_section(self.whiteimage)
        retVal, rotation = encoder.should_capture_frame_for_section(
            self.blackimage)

        self.assertTrue(retVal)
        self.assertEqual(0, rotation)
コード例 #4
0
ファイル: test_encoder.py プロジェクト: kyapp69/peachyscanner
    def test_should_capture_frame_for_section_returns_true_and_current_index_given_change_detected(
            self):
        encoder = Encoder(threshold=450, null_zone=50)
        should_capture, idx = encoder.should_capture_frame_for_section(
            self.whiteimage)

        self.assertTrue(should_capture)
        should_capture, idx = encoder.should_capture_frame_for_section(
            self.whiteimage)
        self.assertFalse(should_capture)