Esempio n. 1
0
    def test_step_will_increment_the_call_count_of_the_given_caller(self):
        """testing if the step method will increment the step of the caller
        """
        pm = ProgressDialogManager()
        caller = pm.register(100)
        self.assertEqual(caller.current_step, 0)

        pm.step(caller)
        self.assertEqual(caller.current_step, 1)

        pm.step(caller)
        self.assertEqual(caller.current_step, 2)
Esempio n. 2
0
    def test_step_will_increment_the_call_count_of_the_given_caller(self):
        """testing if the step method will increment the step of the caller
        """
        pm = ProgressDialogManager()
        caller = pm.register(100)
        self.assertEqual(caller.current_step, 0)

        pm.step(caller)
        self.assertEqual(caller.current_step, 1)

        pm.step(caller)
        self.assertEqual(caller.current_step, 2)
Esempio n. 3
0
    def test_step_will_step_the_progress_dialog(self):
        """testing if the step method will call QProgressDialog.setRange()
        properly
        """
        pm = ProgressDialogManager()
        caller = pm.register(5, "test title")
        pm.step(caller, 2)

        self.assertIn("setRange", pm.dialog.call_info)

        # check the values
        self.assertEqual(pm.dialog.call_info["setRange"], [(0, 5), {}])
        self.assertEqual(pm.dialog.call_info["setValue"], [(2,), {}])
Esempio n. 4
0
    def test_step_will_step_the_progress_dialog(self):
        """testing if the step method will call QProgressDialog.setRange()
        properly
        """
        pm = ProgressDialogManager()
        caller = pm.register(5, 'test title')
        pm.step(caller, 2)

        self.assertIn('setRange', pm.dialog.call_info)

        # check the values
        self.assertEqual(pm.dialog.call_info['setRange'], [(0, 5), {}])
        self.assertEqual(pm.dialog.call_info['setValue'], [(2, ), {}])
Esempio n. 5
0
    def test_step_will_set_the_dialog_title(self):
        """testing if the step method will set the dialog title to the stepped
        caller
        """
        pm = ProgressDialogManager()
        test_title1 = "test title 1"
        test_title2 = "test title 2"
        caller1 = pm.register(5, test_title1)
        caller2 = pm.register(5, test_title2)
        pm.step(caller1)
        self.assertEqual(pm.dialog.call_info["setLabelText"], [("%s : " % test_title1,), {}])

        pm.step(caller2)
        self.assertEqual(pm.dialog.call_info["setLabelText"], [("%s : " % test_title2,), {}])
Esempio n. 6
0
    def test_step_will_set_the_dialog_title(self):
        """testing if the step method will set the dialog title to the stepped
        caller
        """
        pm = ProgressDialogManager()
        test_title1 = 'test title 1'
        test_title2 = 'test title 2'
        caller1 = pm.register(5, test_title1)
        caller2 = pm.register(5, test_title2)
        pm.step(caller1)
        self.assertEqual(pm.dialog.call_info['setLabelText'],
                         [('%s : ' % test_title1, ), {}])

        pm.step(caller2)
        self.assertEqual(pm.dialog.call_info['setLabelText'],
                         [('%s : ' % test_title2, ), {}])