def widget_with_context(self, domain, conditions): ch = SelectRowsContextHandler() context = ch.new_context(domain, *ch.encode_domain(domain)) context.values = dict(conditions=conditions) settings = dict(context_settings=[context]) return self.create_widget(OWSelectRows, settings)
def widget_with_context(self, domain, conditions): ch = SelectRowsContextHandler() context = ch.new_context(domain, *ch.encode_domain(domain)) context.values = dict(conditions=conditions) settings = dict(context_settings=[context]) return self.create_widget(OWSelectRows, settings)
def widget_with_context(self, domain, conditions): ch = SelectRowsContextHandler() context = ch.new_context(domain, *ch.encode_domain(domain)) context.values = {"conditions": conditions, VERSION_KEY: OWSelectRows.settings_version} settings = dict(context_settings=[context]) return self.create_widget(OWSelectRows, settings)
def test_migration_to_version_1(self): iris = Table("iris") ch = SelectRowsContextHandler() context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain)) context.values = dict(conditions=[["petal length", 2, (5.2, )]]) settings = dict(context_settings=[context]) widget = self.create_widget(OWSelectRows, settings) self.assertEqual(widget.conditions, [])