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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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, [])