'MosaicVizrank correctly iterates through states'

def test_iteration(self):

    widget = self.widget
    vizrank = self.vizrank
    widget.set_data(self.iris)
    vizrank.compute_attr_order()
    widget.interior_coloring = widget.CLASS_DISTRIBUTION
    vizrank.max_attrs = 4
    self.assertEqual([state.copy() for state in vizrank.iterate_states(None)], [[0], [1], [2], [3], [0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3], [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 2, 3]])
    self.assertEqual([state.copy() for state in vizrank.iterate_states([0, 3])], [[0, 3], [1, 3], [2, 3], [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 2, 3]])
    vizrank.max_attrs = 2
    self.assertEqual([state.copy() for state in vizrank.iterate_states(None)], [[0], [1], [2], [3], [0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3]])
    self.assertEqual([state.copy() for state in vizrank.iterate_states([0, 3])], [[0, 3], [1, 3], [2, 3]])
    widget.interior_coloring = widget.PEARSON
    vizrank.max_attrs = 4
    self.assertEqual([state.copy() for state in vizrank.iterate_states(None)], [[0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3], [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 2, 3]])
    self.assertEqual([state.copy() for state in vizrank.iterate_states([0, 3])], [[0, 3], [1, 3], [2, 3], [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 2, 3]])
    vizrank.max_attrs = 2
    self.assertEqual([state.copy() for state in vizrank.iterate_states(None)], [[0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3]])
    self.assertEqual([state.copy() for state in vizrank.iterate_states([0, 3])], [[0, 3], [1, 3], [2, 3]])
