Ejemplo n.º 1
0
 def test_aggregates_widget_setattr(self):
     data = {"a": [1, 2, 3], "b": ["a", "b", "c"]}
     widget = PerspectiveWidget(data)
     widget.aggregates = {
         "a": Aggregate.ANY,
         "b": Aggregate.LAST
     }
     assert widget.aggregates == {
         "a": "any",
         "b": "last"
     }
Ejemplo n.º 2
0
 def test_aggregates_widget_set_all(self):
     data = {"a": [1, 2, 3], "b": ["a", "b", "c"]}
     widget = PerspectiveWidget(data)
     for agg in Aggregate:
         widget.aggregates = {"a": agg}
         assert widget.aggregates == {"a": agg.value}
Ejemplo n.º 3
0
 def test_aggregates_widget_setattr_invalid(self):
     data = {"a": [1, 2, 3], "b": ["a", "b", "c"]}
     widget = PerspectiveWidget(data)
     with raises(PerspectiveError):
         widget.aggregates = {"a": "?"}