本文整理汇总了Python中topydo.lib.TodoBase.TodoBase.has_tag方法的典型用法代码示例。如果您正苦于以下问题:Python TodoBase.has_tag方法的具体用法?Python TodoBase.has_tag怎么用?Python TodoBase.has_tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类topydo.lib.TodoBase.TodoBase
的用法示例。
在下文中一共展示了TodoBase.has_tag方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_tag_double_tag
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_set_tag_double_tag(self):
todo = TodoBase("(C) Foo foo:bar foo:baz")
todo.set_tag('foo', 'blah')
self.assertTrue(todo.has_tag('foo', 'blah'))
self.assertTrue(todo.has_tag('foo', 'bar') or
todo.has_tag('foo', 'baz'))
示例2: test_set_tag_double_value
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_set_tag_double_value(self):
todo = TodoBase("(C) Foo foo:bar baz:bar")
todo.set_tag('foo', 'blah');
self.assertTrue(todo.has_tag('foo'))
self.assertTrue(todo.tag_value('foo'), 'blah')
self.assertTrue(todo.has_tag('baz'))
self.assertTrue(todo.tag_value('baz'), 'bar')
示例3: test_set_tag3
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_set_tag3(self):
todo = TodoBase("(C) Foo foo:bar foo:bar")
todo.set_tag('foo', 'bang', False, 'bar')
self.assertTrue(todo.has_tag('foo'))
self.assertTrue(todo.has_tag('foo', 'bang'))
self.assertFalse(todo.has_tag('foo', 'bar'))
self.assertTrue(re.search(r'\bfoo:bang foo:bang\b', todo.src))
示例4: test_add_tag1
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_add_tag1(self):
todo = TodoBase("(C) Foo")
todo.set_tag('foo', 'bar')
self.assertTrue(todo.has_tag('foo'))
self.assertTrue(todo.has_tag('foo', 'bar'))
self.assertFalse(todo.has_tag('foo', 'baz'))
self.assertFalse(todo.has_tag('bar'))
self.assertTrue(re.search(r'\bfoo:bar\b', todo.src))
示例5: test_parse_tag
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_parse_tag(self):
todo = TodoBase("(C) Test foo:bar foo:baz foo_:baz_ blah:zah:haz")
self.assertTrue(todo.has_tag('foo'))
self.assertTrue(todo.has_tag('foo_'))
self.assertTrue(todo.has_tag('foo', 'bar'))
self.assertTrue(todo.has_tag('foo', 'baz'))
self.assertTrue(todo.has_tag('blah'))
self.assertTrue(todo.has_tag('blah', 'zah:haz'))
示例6: test_remove_specific_tag_value
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_remove_specific_tag_value(self):
todo = TodoBase("(C) Foo kungfoo:bar foo:bar foo:barz")
todo.remove_tag('foo', 'bar')
self.assertTrue(todo.has_tag('foo'))
self.assertTrue(todo.has_tag('kungfoo', 'bar'))
self.assertTrue(todo.has_tag('foo', 'barz'))
self.assertFalse(todo.has_tag('foo', 'bar'))
self.assertTrue(re.search(r'\bkungfoo:bar\b', todo.src))
self.assertTrue(re.search(r'\bfoo:barz\b', todo.src))
self.assertFalse(re.search(r'\bfoo:bar\b', todo.src))
示例7: test_remove_all
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_remove_all(self):
todo = TodoBase("(C) Foo foo:bar foo:baz foo:")
todo.remove_tag('foo')
self.assertFalse(todo.has_tag('foo'))
self.assertFalse(re.search(r'\bfoo:(bar|baz)\b', todo.src))
self.assertTrue(re.search(r'foo:', todo.src))
示例8: test_tag_empty_key
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_tag_empty_key(self):
""" Tag should not be recorded when there is no key. """
todo = TodoBase("(C) Foo :bar")
self.assertFalse(todo.has_tag(''))
示例9: test_tag_empty_value
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_tag_empty_value(self):
""" Tag should not be recorded when there is no value. """
todo = TodoBase("(C) Foo foo:")
self.assertFalse(todo.has_tag('foo'))
示例10: test_set_tag_empty_value
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_set_tag_empty_value(self):
todo = TodoBase("(C) Foo foo:bar foo:baz")
todo.set_tag('foo')
self.assertFalse(todo.has_tag('foo'))
self.assertFalse(re.search(r'\bfoo:', todo.src))
示例11: test_timestamp_tag4
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_timestamp_tag4(self):
todo = TodoBase("009:00")
self.assertTrue(todo.has_tag('009'))
self.assertEqual(todo.tag_value('009'), '00')
self.assertEqual(todo.text(), '')
示例12: test_timestamp_tag3
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_timestamp_tag3(self):
todo = TodoBase("9:00")
self.assertFalse(todo.has_tag('9'))
self.assertEqual(todo.text(), '9:00')
示例13: test_timestamp_tag2
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_timestamp_tag2(self):
todo = TodoBase("12:00a")
self.assertTrue(todo.has_tag('12'))
self.assertEqual(todo.tag_value('12'), '00a')
self.assertEqual(todo.text(), '')
示例14: test_timestamp_tag1
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import has_tag [as 别名]
def test_timestamp_tag1(self):
todo = TodoBase("12:00")
self.assertFalse(todo.has_tag('12'))
self.assertEqual(todo.text(), '12:00')