def test_watch_not_needed(self):
        """

        :return:
        """

        support.create_project(self, 'betty')
        support.add_step(self)
        project = cd.project.internal_project
        project.current_step = project.steps[0]

        self.assertFalse(
            reloading.refresh(mime_text),
            Message('Should not reload if the step has not been run before')
        )

        support.run_command('run')

        project.current_step = project.steps[0]

        self.assertFalse(
            reloading.refresh(mime_text),
            Message('Should not reload if module has not changed recently')
        )

        project.current_step = None
        support.run_command('close')
    def test_watch_not_needed(self):
        """Don't reload modules that haven't changed."""
        support.create_project(self, 'betty')
        support.add_step(self)
        project = cd.project.get_internal_project()
        project.current_step = project.steps[0]

        self.assertFalse(
            reloading.refresh(mime_text),
            Message('Expect no reload if the step has not been run before.'))

        support.run_command('run')
        project.current_step = project.steps[0]

        self.assertFalse(
            reloading.refresh(mime_text),
            Message('Expect no reload if module has not changed recently.'))
    def test_watch_recursive(self):
        """

        :return:
        """

        self.assertTrue(
            reloading.refresh('email', recursive=True, force=True),
            Message('Should reload the email module')
        )
    def test_watch_good_argument(self):
        """

        :return:
        """

        self.assertTrue(
            reloading.refresh('datetime', force=True),
            Message('Should reload the datetime module')
        )
    def test_watch_bad_argument(self):
        """

        :return:
        """

        self.assertFalse(
            reloading.refresh(datetime, force=True),
            Message('Should not reload not a module')
        )
    def test_watch_not_needed(self):
        """Don't reload modules that haven't changed."""
        support.create_project(self, 'betty')
        support.add_step(self)
        project = cd.project.get_internal_project()
        project.current_step = project.steps[0]

        self.assertFalse(
            reloading.refresh(mime_text),
            Message('Expect no reload if the step has not been run before.')
        )

        support.run_command('run')
        project.current_step = project.steps[0]

        self.assertFalse(
            reloading.refresh(mime_text),
            Message('Expect no reload if module has not changed recently.')
        )
 def test_watch_recursive(self):
     """Should reload the email module."""
     self.assertTrue(reloading.refresh('email', recursive=True, force=True),
                     Message('Expected email module to be reloaded.'))
 def test_watch_good_argument(self):
     """Should reload the specified package/subpackage"""
     self.assertTrue(reloading.refresh('datetime', force=True),
                     Message('Should reload the datetime module'))
 def test_watch_recursive(self):
     """Should reload the email module."""
     self.assertTrue(
         reloading.refresh('email', recursive=True, force=True),
         Message('Expected email module to be reloaded.')
     )
Example #10
0
 def test_watch_good_argument(self):
     """Should reload the specified package/subpackage"""
     self.assertTrue(
         reloading.refresh('datetime', force=True),
         Message('Should reload the datetime module')
     )
Example #11
0
 def test_watch_bad_argument(self):
     """Should not reload a module"""
     self.assertFalse(
         reloading.refresh(datetime, force=True),
         Message('Should not reload not a module')
     )