コード例 #1
0
ファイル: test_ComboBox.py プロジェクト: rosemberg-al/kiwi
 def setUp(self):
     self.model = Settable(attr=0)
     proxy = Proxy(FakeView(), self.model)
     self.combo = disabledeprecationcall(self.type)
     self.combo.data_type = int
     self.combo.model_attribute = 'attr'
     self.combo.prefill([('foo', 0), ('bar', 1)])
     proxy.add_widget('attr', self.combo)
     self.combo.show()
コード例 #2
0
ファイル: test_ComboBox.py プロジェクト: rcaferraz/kiwi
 def setUp(self):
     self.model = Settable(attr=0)
     proxy = Proxy(FakeView(), self.model)
     self.combo = disabledeprecationcall(self.type)
     self.combo.data_type = int
     self.combo.model_attribute = 'attr'
     self.combo.prefill([('foo', 0),
                         ('bar', 1)])
     proxy.add_widget('attr', self.combo)
     self.combo.show()
コード例 #3
0
ファイル: test_ComboBox.py プロジェクト: rosemberg-al/kiwi
    def test_prefill_attr_none(self):
        model = Settable(attr=None)
        proxy = Proxy(FakeView(), model)
        combo = ProxyComboEntry()
        combo.data_type = int
        combo.model_attribute = 'attr'
        combo.prefill([('foo', 10), ('bar', 20)])
        proxy.add_widget('attr', combo)

        self.assertEqual(model.attr, None)
コード例 #4
0
ファイル: test_ComboBox.py プロジェクト: hackedbellini/kiwi
    def test_prefill_attr_none(self):
        model = Settable(attr=None)
        proxy = Proxy(FakeView(), model)
        combo = ProxyComboEntry()
        combo.data_type = int
        combo.model_attribute = 'attr'
        combo.prefill([('foo', 10), ('bar', 20)])
        proxy.add_widget('attr', combo)

        self.assertEqual(model.attr, None)
コード例 #5
0
ファイル: test_ComboBox.py プロジェクト: rosemberg-al/kiwi
    def test_prefill_attr_none(self):
        model = Settable(attr=None)
        proxy = Proxy(FakeView(), model)
        combo = ProxyComboBox()
        combo.data_type = int
        combo.model_attribute = 'attr'
        combo.prefill([('foo', 10), ('bar', 20)])
        proxy.add_widget('attr', combo)

        # Even though attr is None, the combo doesn't allow something
        # not prefilled in it to be selected. In this case, it will select
        # the first item (prefill actually does that) instead.
        self.assertEqual(model.attr, 10)
コード例 #6
0
ファイル: test_ComboBox.py プロジェクト: hackedbellini/kiwi
    def test_prefill_attr_none(self):
        model = Settable(attr=None)
        proxy = Proxy(FakeView(), model)
        combo = ProxyComboBox()
        combo.data_type = int
        combo.model_attribute = 'attr'
        combo.prefill([('foo', 10), ('bar', 20)])
        proxy.add_widget('attr', combo)

        # Even though attr is None, the combo doesn't allow something
        # not prefilled in it to be selected. In this case, it will select
        # the first item (prefill actually does that) instead.
        self.assertEqual(model.attr, 10)