本文整理汇总了Python中quodlibet.qltk.entry.ValidatingEntry.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python ValidatingEntry.destroy方法的具体用法?Python ValidatingEntry.destroy怎么用?Python ValidatingEntry.destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quodlibet.qltk.entry.ValidatingEntry
的用法示例。
在下文中一共展示了ValidatingEntry.destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TValidatingEntry
# 需要导入模块: from quodlibet.qltk.entry import ValidatingEntry [as 别名]
# 或者: from quodlibet.qltk.entry.ValidatingEntry import destroy [as 别名]
class TValidatingEntry(TestCase):
def setUp(self):
quodlibet.config.init()
self.entry = ValidatingEntry(QueryValidator)
def test_changed_simple(self):
self.entry.set_text("valid")
def test_changed_valid(self):
self.entry.set_text("search = 'valid'")
def test_changed_invalid(self):
self.entry.set_text("=#invalid")
def test_custom_validator(self):
x = []
def valid(text):
x.append(text)
return text
entry = ValidatingEntry(valid)
entry.set_text("foo")
self.assertEqual(x, [u"foo"])
self.assertTrue(isinstance(x[0], unicode))
def tearDown(self):
self.entry.destroy()
quodlibet.config.quit()
示例2: TValidatingEntry
# 需要导入模块: from quodlibet.qltk.entry import ValidatingEntry [as 别名]
# 或者: from quodlibet.qltk.entry.ValidatingEntry import destroy [as 别名]
class TValidatingEntry(TestCase):
def setUp(self):
quodlibet.config.init()
self.entry = ValidatingEntry(Query.is_valid_color)
def test_changed_simple(self):
self.entry.set_text("valid")
def test_changed_valid(self):
self.entry.set_text("search = 'valid'")
def test_changed_invalid(self):
self.entry.set_text("=#invalid")
def tearDown(self):
self.entry.destroy()
quodlibet.config.quit()