예제 #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
파일: valet.py 프로젝트: bevesce/valet
 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))