コード例 #1
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_render_less_than_or_equal_to_comparison(self):
     word = SearchKeyword(5, 'and', '<=')
     fl = SearchFilter('power', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'power=+<=[5]')
コード例 #2
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_parse_logical_or(self):
     first = SearchKeyword('first', 'or')
     strike = SearchKeyword('strike', 'or')
     fl = SearchFilter('text', keywords=[first, strike])
     self.assertEqual(fl.url_fragment(), 'text=|[first]|[strike]')
コード例 #3
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_render_greater_than_comparison(self):
     word = SearchKeyword(5, 'and', '>')
     fl = SearchFilter('power', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'power=+>[5]')
コード例 #4
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_assume_exact_quote_if_spaces(self):
     word = SearchKeyword('first strike', 'and')
     fl = SearchFilter('text', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'text=+["first strike"]')
コード例 #5
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_assume_exact_quote_if_spaces(self):
     word = SearchKeyword('first strike', 'and')
     fl = SearchFilter('text', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'text=+["first strike"]')
コード例 #6
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_group_url_keywords_if_excluding_others(self):
     word = SearchKeyword('w', 'and')
     fl = SearchFilter('color', keywords=[word])
     fl.exclude_others = True
     self.assertEqual(fl.url_fragment(), 'color=+@(+[w])')
コード例 #7
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_not_quote_rarities(self):
     word = SearchKeyword('M', 'and')
     fl = SearchFilter('rarity', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'rarity=+[M]')
コード例 #8
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_group_url_keywords_if_excluding_others(self):
     word = SearchKeyword('w', 'and')
     fl = SearchFilter('color', keywords=[word])
     fl.exclude_others = True
     self.assertEqual(fl.url_fragment(), 'color=+@(+[w])')
コード例 #9
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_group_url_keywords_if_excluding_other_types(self):
     word = SearchKeyword('goblin', 'and')
     fl = SearchFilter('type', keywords=[word])
     fl.exclude_others = True
     self.assertEqual(fl.url_fragment(), 'type=+@(+[goblin])')
コード例 #10
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_render_equality_comparison(self):
     word = SearchKeyword(5, 'and', '=')
     fl = SearchFilter('power', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'power=+=[5]')
コード例 #11
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_separate_and_words(self):
     sengir = SearchKeyword('sengir', 'and')
     vampire = SearchKeyword('vampire', 'and')
     fl = SearchFilter('name', keywords=[sengir, vampire])
     self.assertEqual(fl.url_fragment(), 'name=+[sengir]+[vampire]')
コード例 #12
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_render_less_than_or_equal_to_comparison(self):
     word = SearchKeyword(5, 'and', '<=')
     fl = SearchFilter('power', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'power=+<=[5]')
コード例 #13
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_render_greater_than_comparison(self):
     word = SearchKeyword(5, 'and', '>')
     fl = SearchFilter('power', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'power=+>[5]')
コード例 #14
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_parse_logical_or(self):
     first = SearchKeyword('first', 'or')
     strike = SearchKeyword('strike', 'or')
     fl = SearchFilter('text', keywords=[first, strike])
     self.assertEqual(fl.url_fragment(), 'text=|[first]|[strike]')
コード例 #15
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_render_equality_comparison(self):
     word = SearchKeyword(5, 'and', '=')
     fl = SearchFilter('power', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'power=+=[5]')
コード例 #16
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_not_quote_rarities(self):
     word = SearchKeyword('M', 'and')
     fl = SearchFilter('rarity', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'rarity=+[M]')
コード例 #17
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_separate_and_words(self):
     sengir = SearchKeyword('sengir', 'and')
     vampire = SearchKeyword('vampire', 'and')
     fl = SearchFilter('name', keywords=[sengir, vampire])
     self.assertEqual(fl.url_fragment(), 'name=+[sengir]+[vampire]')
コード例 #18
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_render_not_operator(self):
     word = SearchKeyword('graveyard', 'not')
     fl = SearchFilter('text', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'text=+![graveyard]')
コード例 #19
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_group_url_keywords_if_excluding_other_types(self):
     word = SearchKeyword('goblin', 'and')
     fl = SearchFilter('type', keywords=[word])
     fl.exclude_others = True
     self.assertEqual(fl.url_fragment(), 'type=+@(+[goblin])')
コード例 #20
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_group_text_in_brackets(self):
     word = SearchKeyword('trample', 'and')
     fl = SearchFilter('text', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'text=+[trample]')
コード例 #21
0
ファイル: test_gatherer_request.py プロジェクト: Miserlou/mtg
 def should_render_not_operator(self):
     word = SearchKeyword('graveyard', 'not')
     fl = SearchFilter('text', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'text=+![graveyard]')
コード例 #22
0
ファイル: test_gatherer_request.py プロジェクト: two-jays/mtg
 def should_group_text_in_brackets(self):
     word = SearchKeyword('trample', 'and')
     fl = SearchFilter('text', keywords=[word])
     self.assertEqual(fl.url_fragment(), 'text=+[trample]')