Пример #1
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Remove the temporary directory and variable (if there is a deletion failure, continue to allow the test suite to survive).
        try:
            deletion(obj=ds, name='tmpdir', dir=True)
        except:
            pass
        try:
            deletion(obj=self, name='tmpdir', dir=True)
        except:
            pass

        # Remove temporary file and variable (if there is a deletion failure, continue to allow the test suite to survive).
        try:
            deletion(obj=ds, name='tmpfile', dir=False)
        except:
            pass
        try:
            deletion(obj=self, name='tmpfile', dir=False)
        except:
            pass

        # Reset relax.
        reset()
Пример #2
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Remove the temporary directory and variable (if there is a deletion failure, continue to allow the test suite to survive).
        try:
            deletion(obj=ds, name='tmpdir', dir=True)
        except:
            pass
        try:
            deletion(obj=self, name='tmpdir', dir=True)
        except:
            pass

        # Remove temporary file and variable (if there is a deletion failure, continue to allow the test suite to survive).
        try:
            # Close the open file handles on the OS level.
            close(ds.tmpfile_handle)

            # Delete the temporary files.
            deletion(obj=ds, name='tmpfile', dir=False)
        except:
            pass
        try:
            # Close the open file handles on the OS level.
            close(self.tmpfile_handle)

            # Delete the temporary files.
            deletion(obj=self, name='tmpfile', dir=False)
        except:
            pass

        # Reset relax.
        reset()
Пример #3
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Remove the temporary directory and variable.
        deletion(obj=ds, name='tmpdir', dir=True)
        deletion(obj=self, name='tmpdir', dir=True)

        # Remove temporary file and variable.
        deletion(obj=ds, name='tmpfile', dir=False)
        deletion(obj=self, name='tmpfile', dir=False)

        # Reset relax.
        reset()
Пример #4
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Remove the temporary directory and variable.
        deletion(obj=ds, name="tmpdir", dir=True)
        deletion(obj=self, name="tmpdir", dir=True)

        # Remove temporary file and variable.
        deletion(obj=ds, name="tmpfile", dir=False)
        deletion(obj=self, name="tmpfile", dir=False)

        # Reset relax.
        reset()
Пример #5
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Flush all wx events prior to the clean up operations of this method.  This prevents these events from occurring after the GUI elements have been deleted.
        wx.Yield()

        # Remove the temporary directory and variable.
        deletion(obj=ds, name='tmpdir', dir=True)
        deletion(obj=self, name='tmpdir', dir=True)

        # Remove temporary file and variable.
        deletion(obj=ds, name='tmpfile', dir=False)
        deletion(obj=self, name='tmpfile', dir=False)

        # Reset relax.
        reset()
Пример #6
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Flush all wx events prior to the clean up operations of this method.  This prevents these events from occurring after the GUI elements have been deleted.
        wx.Yield()

        # Remove the temporary directory and variable.
        deletion(obj=ds, name='tmpdir', dir=True)
        deletion(obj=self, name='tmpdir', dir=True)

        # Remove temporary file and variable.
        deletion(obj=ds, name='tmpfile', dir=False)
        deletion(obj=self, name='tmpfile', dir=False)

        # Reset relax.
        reset()

        # Get the wx app.
        self.app = wx.GetApp()

        # Kill all windows.
        self.clean_up_windows()

        # Print out a list of all living windows to help ensure that custom Close() and Destroy() methods are cleaning up all objects.
        print(
            "\n\nList of all living GUI elements - this must only include the main GUI window and the relax controller:"
        )
        all_destroyed = True
        for window in wx.GetTopLevelWindows():
            # Printout.
            print("    Window: %s" % window)
            if isinstance(window, Wiz_window):
                print("        Wizard title: %s" % window.title)
                print("        Wizard pages: %s" % window._pages)

            # Skip the main GUI window and the relax controller.
            if isinstance(window, Main) or isinstance(window, Controller):
                continue

            # Failure of memory management.
            all_destroyed = False
        print("\n\n\n")
Пример #7
0
    def tearDown(self):
        """Default tearDown operation - delete temp directories and files and reset relax."""

        # Flush all wx events prior to the clean up operations of this method.  This prevents these events from occurring after the GUI elements have been deleted.
        wx.Yield()

        # Remove the temporary directory and variable.
        deletion(obj=ds, name='tmpdir', dir=True)
        deletion(obj=self, name='tmpdir', dir=True)

        # Remove temporary file and variable.
        deletion(obj=ds, name='tmpfile', dir=False)
        deletion(obj=self, name='tmpfile', dir=False)

        # Reset relax.
        reset()

        # Get the wx app.
        self.app = wx.GetApp()

        # Kill all windows.
        self.clean_up_windows()

        # Print out a list of all living windows to help ensure that custom Close() and Destroy() methods are cleaning up all objects.
        print("\n\nList of all living GUI elements - this must only include the main GUI window and the relax controller:")
        all_destroyed = True
        for window in wx.GetTopLevelWindows():
            # Printout.
            print("    Window: %s" % window)
            if isinstance(window, Wiz_window):
                print("        Wizard title: %s" % window.title)
                print("        Wizard pages: %s" % window._pages)

            # Skip the main GUI window and the relax controller.
            if isinstance(window, Main) or isinstance(window, Controller):
                continue

            # Failure of memory management.
            all_destroyed = False
        print("\n\n\n")
Пример #8
0
    def tearDown(self):
        """Clean up after the library tests."""

        # Remove the temporary directory and all its contents.
        deletion(obj=self, name='tmpdir', dir=True)
Пример #9
0
    def tearDown(self):
        """Clean up after the library tests."""

        # Remove the temporary directory and all its contents.
        deletion(obj=self, name='tmpdir', dir=True)