Ignore:
Timestamp:
Jun 8, 2016 9:56:28 AM (8 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
5032ea68
Parents:
f721030
git-author:
Piotr Rozyczko <piotr.rozyczko@…> (06/08/16 09:53:59)
git-committer:
Piotr Rozyczko <piotr.rozyczko@…> (06/08/16 09:56:28)
Message:

Hold data objects in model. Added more Data Explorer functionality. Added unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/UnitTesting/TestUtils.py

    rf721030 r488c49d  
    1212        super(QtSignalSpy, self).__init__(parent) 
    1313 
    14         self._connector = {} 
     14        self._recorder = {} 
    1515        self._count = 0 
    16         self._signal = [None, None] 
     16        self._signal = [] 
    1717 
    1818        # Assign our own slot to the emitted signal 
    19         if isinstance(signal, pyqtBoundSignal): 
    20             signal.connect(self.slot) 
    21         elif hasattr(widget, signal): 
    22             getattr(widget, signal).connect(self.slot) 
    23         else: 
    24             widget.signal.connect(slot) 
     19        try: 
     20            if isinstance(signal, pyqtBoundSignal): 
     21                signal.connect(self.slot) 
     22            elif hasattr(widget, signal): 
     23                getattr(widget, signal).connect(self.slot) 
     24            else: 
     25                widget.signal.connect(slot) 
     26        except AttributeError: 
     27            msg = "Wrong construction of QtSignalSpy instance" 
     28            raise RuntimeError, msg 
    2529 
    2630    def slot(self, *args, **kwargs): 
     
    2832        Record emitted signal. 
    2933        """ 
    30         self._connector[self._count] = { 
     34        self._recorder[self._count] = { 
    3135            'args'   : args, 
    3236            'kwargs' : kwargs, 
     
    3741 
    3842    def signal(self, index=None): 
    39         """ 
    40         """ 
    4143        if index == None: 
    4244            return self._signal 
     
    4547 
    4648    def count(self): 
    47         """ 
    48         """ 
    4949        return self._count 
    5050 
    5151    def called(self): 
    52         """ 
    53         """ 
    54         return self._connector 
     52        return self._recorder 
Note: See TracChangeset for help on using the changeset viewer.