示例#1
0
 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'
示例#2
0
    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
示例#3
0
文件: test_naer.py 项目: zdict/zdict
    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
示例#4
0
文件: test_apc.py 项目: juneman/zdict
    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
示例#5
0
    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
示例#6
0
    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
示例#7
0
    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
示例#8
0
 def setup_class(cls):
     cls.dict = JishoDict(get_args())
     cls.word = 'apple'
     cls.record = cls.dict.query(cls.word)
示例#9
0
 def setup_class(cls):
     cls.dict = JishoDict(get_args())
     cls.word = 'bird'
     cls.source = 'jisho'
     cls.record = cls.dict.query(cls.word)
示例#10
0
文件: test_yahoo.py 项目: zdict/zdict
 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]
示例#11
0
文件: test_urban.py 项目: ilcic/zdict
 def setup_method(self, method):
     self.dict = UrbanDict(get_args())
示例#12
0
文件: test_yahoo.py 项目: ilcic/zdict
 def setup_method(self, method):
     self.dict = YahooDict(get_args())
示例#13
0
 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)
示例#14
0
 def setup_method(self, method):
     self.dict = OxfordDictionary(get_args())
示例#15
0
 def setup_method(self, method):
     self.dict = WiktionaryDict(get_args())
示例#16
0
 def setup_class(cls):
     cls.dict = SpanishDict(get_args())
     cls.word = 'Spanish'
     cls.record = cls.dict.query(cls.word)
示例#17
0
 def setup_method(self, method):
     self.dict = UrbanDict(get_args())
示例#18
0
 def setup_class(cls):
     cls.dict = YahooDict(get_args())
     cls.word = 'style'
     cls.record = cls.dict.query(cls.word)
示例#19
0
 def setup_method(self, method):
     self.dict = MoeDictTaiwanese(get_args())
示例#20
0
 def setup_method(self, method):
     self.dict = WiktionaryDict(get_args())
示例#21
0
文件: test_yahoo.py 项目: zdict/zdict
 def setup_class(cls):
     cls.dict = YahooDict(get_args())
     cls.words = ['style', 'metadata']
     cls.records = [cls.dict.query(word) for word in cls.words]
示例#22
0
 def setup_method(self, method):
     self.dict = YandexDict(get_args())
示例#23
0
文件: test_jisho.py 项目: ilcic/zdict
 def setup_class(cls):
     cls.dict = JishoDict(get_args())
     cls.word = 'apple'
     cls.record = cls.dict.query(cls.word)
示例#24
0
文件: test_moe.py 项目: zhengda/zdict
 def setup_method(self, method):
     self.dict = MoeDict(get_args())
示例#25
0
 def setup_method(self, method):
     self.dict = OxfordDictionary(get_args())