Changeset 2093

Show
Ignore:
Timestamp:
09/06/07 04:51:18 (1 year ago)
Author:
arj..@yirdis.nl
Message:

Added assertions to Solver.add/remove_constraint. updated unit tests.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/gaphas/solver.py

    r1917 r2093  
    443443        1 
    444444        """ 
     445        assert constraint, 'No constraint (%s)' % (constraint,) 
    445446        self._constraints.add(constraint) 
    446447        self._marked_cons.append(constraint) 
     
    476477        >>> s.remove_constraint(c) 
    477478        """ 
     479        assert constraint, 'No constraint (%s)' % (constraint,) 
    478480        for v in constraint.variables(): 
    479481            while isinstance(v, Projection): 
  • gaphas/trunk/gaphas/view.py

    r2082 r2093  
    472472        >>> a = gtk.Adjustment() 
    473473        >>> v._hadjustment = a 
    474         >>> v._update_adjustment(a, 10, 100, 20) 
     474        >>> v._update_adjustment(a, 10, 100, 0, 20) 
    475475        >>> a.page_size, a.page_increment, a.value 
    476         (20.0, 20.0, 10.0) 
     476        (20.0, 20.0, 0.0) 
    477477        """ 
    478478        #canvas_size += viewport_size 
  • gaphas/trunk/undo.txt

    r1882 r2093  
    420420    [] 
    421421 
     422    >>> undo_list[:] = redo_list[:] 
     423    >>> undo() 
     424    >>> list(s.constraints_with_variable(a)) 
     425    [EquationConstraint(<lambda>, a=Variable(1, 20), b=Variable(2, 20))] 
     426