-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestsuite.py
More file actions
36 lines (25 loc) · 777 Bytes
/
testsuite.py
File metadata and controls
36 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
""" Run is the main function that will check if the recode and bibtex
modules are working """
def check_recode():
try:
import recode
except SystemError:
raise RuntimeError('the recode library is probably broken.')
# First, check if the recode version has the famous 3.6 bug
rq = recode.request('UTF-8..latex')
if recode.recode(rq, 'abc') != 'abc':
raise RuntimeError('the _recode module is broken.')
return 0
def expected_result(obtained, valid):
if obtained == valid:
return True
try:
return eval(obtained) == eval(valid)
except SyntaxError:
return False
def run():
failures = 0
failures += check_recode()
raise RuntimeError
return failures