def setup_class(cls): cls.dict = SpanishDict(get_args()) cls.en_word = 'Spanish' cls.en_record = cls.dict.query(cls.en_word) cls.es_word = 'tranquilo' cls.es_record = cls.dict.query(cls.es_word) cls.not_found_word = 'asdfsdf'
def setup_class(cls): cls.dict = iTaigiDict(get_args()) cls.words = ['芭樂', '測試'] # Setup normal query data cls.dict.args.verbose = False cls.records = [cls.dict.query(word) for word in cls.words] # Setup verbose query data cls.dict.args.verbose = True cls.verbose_records = [cls.dict.query(word) for word in cls.words] # Change back to default verbose config cls.dict.args.verbose = False
def setup_class(cls): cls.dict = NaerDict(get_args()) # You may want to change words to some certain test cases. cls.words = ['西爾河', 'spring mass'] cls.not_found_word = 'dsafwwe' # Set query_timeout from 5 seconds to 120 seconds, # so it won't timeout that often. cls.dict.args.query_timeout = 120 # Setup normal query data cls.dict.args.verbose = False cls.records = [] for word in cls.words: record = None while True: try: record = cls.dict.query(word) except Exception: # prevent API 500 error time.sleep(5) continue else: cls.records.append(record) break cls.records = [cls.dict.query(word) for word in cls.words] # Setup verbose query data cls.dict.args.verbose = True cls.verbose_records = [] for word in cls.words: record = None while True: try: record = cls.dict.query(word) except Exception: # prevent API 500 error time.sleep(5) continue else: cls.verbose_records.append(record) break # Change back to default verbose config cls.dict.args.verbose = False
def setup_class(cls): cls.dict = ApcDict(get_args()) # You may want to change words to some certain test cases. cls.words = ["utux", "tux"] cls.not_found_word = "dsafwwe" # Setup normal query data cls.dict.args.verbose = False cls.records = [cls.dict.query(word) for word in cls.words] # Setup verbose query data cls.dict.args.verbose = True cls.verbose_records = [cls.dict.query(word) for word in cls.words] # Change back to default verbose config cls.dict.args.verbose = False
def setup_class(cls): cls.dict = NaerDict(get_args()) # You may want to change words to some certain test cases. cls.words = ['西爾河', 'spring mass'] cls.not_found_word = 'dsafwwe' # Setup normal query data cls.dict.args.verbose = False cls.records = [cls.dict.query(word) for word in cls.words] # Setup verbose query data cls.dict.args.verbose = True cls.verbose_records = [cls.dict.query(word) for word in cls.words] # Change back to default verbose config cls.dict.args.verbose = False
def setup_class(cls): cls.dict = iTaigiDict(get_args()) cls.words = ['芭樂', '測試'] # Set query_timeout from 5 seconds to 60 seconds, # so it won't timeout that often. cls.dict.args.query_timeout = 60 # Setup normal query data cls.dict.args.verbose = False cls.records = [cls.dict.query(word) for word in cls.words] # Setup verbose query data cls.dict.args.verbose = True cls.verbose_records = [cls.dict.query(word) for word in cls.words] # Change back to default verbose config cls.dict.args.verbose = False
def setup_class(cls): cls.dict = iTaigiDict(get_args()) cls.words = ['芭樂', '測試'] # Set query_timeout from 5 seconds to 60 seconds, # so it won't timeout that often. cls.dict.args.query_timeout = 60 # Setup normal query data cls.dict.args.verbose = False cls.records = [] for word in cls.words: record = None while True: try: record = cls.dict.query(word) except Exception: # prevent itaigi API 500 error time.sleep(5) continue else: cls.records.append(record) break # Setup verbose query data cls.dict.args.verbose = True cls.verbose_records = [] for word in cls.words: record = None while True: try: record = cls.dict.query(word) except Exception: # prevent itaigi API 500 error time.sleep(5) continue else: cls.verbose_records.append(record) break # Change back to default verbose config cls.dict.args.verbose = False
def setup_class(cls): cls.dict = JishoDict(get_args()) cls.word = 'apple' cls.record = cls.dict.query(cls.word)
def setup_class(cls): cls.dict = JishoDict(get_args()) cls.word = 'bird' cls.source = 'jisho' cls.record = cls.dict.query(cls.word)
def setup_class(cls): cls.dict = YahooDict(get_args()) cls.words = ['style', 'metadata', 'apples', 'google', 'hold on'] cls.records = [cls.dict.query(word) for word in cls.words]
def setup_method(self, method): self.dict = UrbanDict(get_args())
def setup_method(self, method): self.dict = YahooDict(get_args())
def setup_class(cls): cls.dict = UrbanDict(get_args()) cls.not_found_word = 'some_not_existing_word' cls.word = 'urban' cls.record = cls.dict.query(cls.word)
def setup_method(self, method): self.dict = OxfordDictionary(get_args())
def setup_method(self, method): self.dict = WiktionaryDict(get_args())
def setup_class(cls): cls.dict = SpanishDict(get_args()) cls.word = 'Spanish' cls.record = cls.dict.query(cls.word)
def setup_class(cls): cls.dict = YahooDict(get_args()) cls.word = 'style' cls.record = cls.dict.query(cls.word)
def setup_method(self, method): self.dict = MoeDictTaiwanese(get_args())
def setup_class(cls): cls.dict = YahooDict(get_args()) cls.words = ['style', 'metadata'] cls.records = [cls.dict.query(word) for word in cls.words]
def setup_method(self, method): self.dict = YandexDict(get_args())
def setup_method(self, method): self.dict = MoeDict(get_args())