<s> import unittest <EOL> try : <EOL> from pyface . ui . wx . grid . api import GridRow , GridColumn , SimpleGridModel <EOL> except ImportError : <EOL> wx_available = False <EOL> else : <EOL> wx_available = True <EOL> @ unittest . skipUnless ( wx_available , "<STR_LIT>" ) <EOL> class CompositeGridModelTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . model = SimpleGridModel ( data = [ [ None , <NUM_LIT:2> ] , [ <NUM_LIT:3> , <NUM_LIT:4> ] ] , <EOL> rows = [ GridRow ( label = '<STR_LIT:foo>' ) , <EOL> GridRow ( label = '<STR_LIT:bar>' ) ] , <EOL> columns = [ GridColumn ( label = '<STR_LIT>' ) , <EOL> GridColumn ( label = '<STR_LIT>' ) ] <EOL> ) <EOL> return <EOL> def test_get_column_count ( self ) : <EOL> self . assertEqual ( self . model . get_column_count ( ) , <NUM_LIT:2> ) <EOL> return <EOL> def test_get_row_count ( self ) : <EOL> self . assertEqual ( self . model . get_row_count ( ) , <NUM_LIT:2> ) <EOL> return <EOL> def test_get_row_name ( self ) : <EOL> self . assertEqual ( self . model . get_row_name ( <NUM_LIT:0> ) , '<STR_LIT:foo>' ) <EOL> self . assertEqual ( self . model . get_row_name ( <NUM_LIT:1> ) , '<STR_LIT:bar>' ) <EOL> return <EOL> def test_get_column_name ( self ) : <EOL> self . assertEqual ( self . model . get_column_name ( <NUM_LIT:0> ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . model . get_column_name ( <NUM_LIT:1> ) , '<STR_LIT>' ) <EOL> return <EOL> def test_get_value ( self ) : <EOL> self . assertEqual ( self . model . get_value ( <NUM_LIT:0> , <NUM_LIT:0> ) , None ) <EOL> self . assertEqual ( self . model . get_value ( <NUM_LIT:0> , <NUM_LIT:1> ) , <NUM_LIT:2> ) <EOL> self . assertEqual ( self . model . get_value ( <NUM_LIT:1> , <NUM_LIT:0> ) , <NUM_LIT:3> ) <EOL> self . assertEqual ( self . model . get_value ( <NUM_LIT:1> , <NUM_LIT:1> ) , <NUM_LIT:4> ) <EOL> return <EOL> def test_is_cell_empty ( self ) : <EOL> rows = self . model . get_row_count ( ) <EOL> columns = self . model . get_column_count ( ) <EOL> self . assertEqual ( self . model . is_cell_empty ( <NUM_LIT:0> , <NUM_LIT:0> ) , True , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . model . is_cell_empty ( <NUM_LIT:10> , <NUM_LIT:10> ) , True , <EOL> "<STR_LIT>" ) <EOL> return </s>
