Changeset 348

Show
Ignore:
Timestamp:
09/09/07 23:19:02 (6 years ago)
Author:
bjourne
Message:

Add tests for ImageView.get_check_colors() and ImageNav.init().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pygtkimageview/tests/test_module.py

    r344 r348  
    110110    assert int(col1) 
    111111    assert int(col2) 
     112 
     113def test_get_check_colors_many_args(): 
     114    ''' 
     115    Ensure that a correct error is thrown when get_check_colors() is 
     116    invoked with to many arguments. 
     117    ''' 
     118    view = gtkimageview.ImageView() 
     119    try: 
     120        view.get_check_colors(1, 2, 3) 
     121        assert False 
     122    except TypeError: 
     123        assert True 
     124 
     125def test_image_nav_wrong_nr_args(): 
     126    ''' 
     127    Ensure that TypeError is raised when ImageNav is instantiated with 
     128    the wrong nr of args. 
     129    ''' 
     130    try: 
     131        nav = gtkimageview.ImageNav() 
     132        assert False 
     133    except TypeError: 
     134        assert True 
     135    try: 
     136        nav = gtkimageview.ImageNav(gtkimageview.ImageView(), None, None) 
     137        assert False 
     138    except TypeError: 
     139        assert True