Пример #1
0
def politics_first(a, b):
    a_has_tag = tags.has_tag("australia-news/australian-politics", a)
    b_has_tag = tags.has_tag("australia-news/australian-politics", b)

    if a_has_tag and not b_has_tag:
        return -1

    if not a_has_tag and b_has_tag:
        return 1

    return 0
Пример #2
0
def politics_first(a, b):
    a_has_tag = tags.has_tag("australia-news/australian-politics", a)
    b_has_tag = tags.has_tag("australia-news/australian-politics", b)

    if a_has_tag and not b_has_tag:
        return -1

    if not a_has_tag and b_has_tag:
        return 1

    return 0
Пример #3
0
 def has_tag(self, tag):
     return tags.has_tag(self.fullpath, tag)
Пример #4
0
 def test_should_detect_whether_a_tag_present(self):
     self.assertTrue(tags.has_tag('world/syria', stub_content_item))
Пример #5
0
 def test_should_detect_whether_a_tag_is_absent(self):
     self.assertFalse(tags.has_tag('world/iraq', stub_content_item))
Пример #6
0
 def test_should_detect_whether_a_tag_is_absent(self):
 	self.assertFalse(tags.has_tag('world/iraq', stub_content_item))
Пример #7
0
 def test_should_detect_whether_a_tag_present(self):
 	self.assertTrue(tags.has_tag('world/syria', stub_content_item))