@@ -29,16 +29,16 @@ def setUpClass(cls):
2929 super ().setUpClass ()
3030 WidgetOutputsTestMixin .init (cls )
3131
32- cls .housing = Table ("housing" )
33- cls .titanic = Table ("titanic" )
34- cls .brown_selected = Table ("brown-selected" )
35-
3632 cls .signal_name = "Data"
3733 cls .signal_data = cls .data
3834
3935 def setUp (self ):
4036 self .widget = self .create_widget (OWHeatMap ) # type: OWHeatMap
4137
38+ self .housing = Table ("housing" )
39+ self .titanic = Table ("titanic" )
40+ self .brown_selected = Table ("brown-selected" )
41+
4242 def test_input_data (self ):
4343 """Check widget's data with data on the input"""
4444 for data in (self .data , self .housing ):
@@ -72,6 +72,9 @@ def test_information_message(self):
7272 self .assertFalse (self .widget .Information .active )
7373 self .send_signal (self .widget .Inputs .data , data [:21 ])
7474 self .assertTrue (self .widget .Information .active )
75+ data = Table ("heart_disease.tab" )[:10 ]
76+ self .send_signal (self .widget .Inputs .data , data )
77+ self .assertTrue (self .widget .Information .discrete_ignored .is_shown ())
7578
7679 def test_settings_changed (self ):
7780 self .send_signal (self .widget .Inputs .data , self .data )
@@ -396,6 +399,14 @@ def test_col_color_annotations_with_na(self):
396399 widget .set_column_annotation_color_var (None )
397400 self .assertFalse (widget .scene .widget .top_side_colors [0 ].isVisible ())
398401
402+ def test_data_with_hidden (self ):
403+ w = self .widget
404+ housing = self .housing .copy ()
405+ housing .domain .attributes [0 ].attributes ["hidden" ] = True
406+ self .send_signal (self .widget .Inputs .data , housing )
407+ self .assertEqual (len (w .effective_data .domain .attributes ),
408+ len (housing .domain .attributes ) - 1 )
409+
399410
400411if __name__ == "__main__" :
401412 unittest .main ()
0 commit comments