示例#1
0
 def test_get_token_from_menace_snippet(self, bestial_menace_text,
                                        snake, wolf, elephant):
     snippets = TokenParser._get_snippets(bestial_menace_text)
     self.assert_token_from_snippet(snippets[0], snake)
     self.assert_token_from_snippet(snippets[1], wolf)
     self.assert_token_from_snippet(snippets[2], elephant)
示例#2
0
 def test_get_token_from_gutter_grime_snippet(self, gutter_grime_text,
                                              gutter_grime):
     snippets = TokenParser._get_snippets(gutter_grime_text)
     self.assert_token_from_snippet(snippets[0], gutter_grime)
示例#3
0
 def test_get_token_from_sprout_snippet(self, sprout_text, saproling):
     snippets = TokenParser._get_snippets(sprout_text)
     self.assert_token_from_snippet(snippets[0], saproling)
示例#4
0
 def test_get_token_from_decree_snippet(self, doj_text, soldier, angel):
     snippets = TokenParser._get_snippets(doj_text)
     self.assert_token_from_snippet(snippets[0], angel)
     self.assert_token_from_snippet(snippets[1], soldier)
示例#5
0
 def assert_expected_number_of_snippets(self, card_text, expected):
     assert len(TokenParser._get_snippets(card_text)) == expected
示例#6
0
 def assert_token_from_snippet(self, snippet, expected):
     assert TokenParser._get_token_from_snippet(snippet) == expected
示例#7
0
 def test_get_token_from_menace_snippet(self, bestial_menace_text, snake,
                                        wolf, elephant):
     snippets = TokenParser._get_snippets(bestial_menace_text)
     self.assert_token_from_snippet(snippets[0], snake)
     self.assert_token_from_snippet(snippets[1], wolf)
     self.assert_token_from_snippet(snippets[2], elephant)
示例#8
0
 def test_get_token_from_gutter_grime_snippet(self, gutter_grime_text,
                                              gutter_grime):
     snippets = TokenParser._get_snippets(gutter_grime_text)
     self.assert_token_from_snippet(snippets[0], gutter_grime)
示例#9
0
 def test_get_token_from_decree_snippet(self, doj_text, soldier, angel):
     snippets = TokenParser._get_snippets(doj_text)
     self.assert_token_from_snippet(snippets[0], angel)
     self.assert_token_from_snippet(snippets[1], soldier)
示例#10
0
 def test_get_token_from_sprout_snippet(self, sprout_text, saproling):
     snippets = TokenParser._get_snippets(sprout_text)
     self.assert_token_from_snippet(snippets[0], saproling)
示例#11
0
 def assert_token_from_snippet(self, snippet, expected):
     assert TokenParser._get_token_from_snippet(snippet) == expected
示例#12
0
 def assert_expected_number_of_snippets(self, card_text, expected):
     assert len(TokenParser._get_snippets(card_text)) == expected
示例#13
0
def token_parser(token_makers):
    return TokenParser(token_makers)