Esempio n. 1
0
def braces2links_does_unknown_words():
    """The braces2links util links jbovlaste for unknown words"""
    same(braces2links('{unknown}', database.root.entries),
         '<a href='
         '"http://jbovlaste.lojban.org/dict/addvalsi.html?valsi=unknown" '
         'title="This word is missing, please add it!" class="missing">'
         'unknown</a>')
Esempio n. 2
0
def compound2affixes_splits_compounds():
    """The compound2affixes util splits compounds into affixes"""
    same(compound2affixes('jbobau'), ['jbo', 'bau'])
    same(compound2affixes('lobybau'), ['lob', 'y', 'bau'])
    same(compound2affixes('jbobangu'), ['jbo', 'bangu'])
    same(compound2affixes('lojbybau'), ['lojb', 'y', 'bau'])
    same(compound2affixes('lobybangu'), ['lob', 'y', 'bangu'])
    same(compound2affixes('lojbybangu'), ['lojb', 'y', 'bangu'])
    same(compound2affixes("ro'inre'o"), ["ro'i", 'n', "re'o"])
Esempio n. 3
0
def sensitive_to_if_none_match_header():
    """Sends a 304 if ETags match"""
    index = client.get('/', headers={'If-None-Match': app.config['ETAG']})
    query = client.get('/coi', headers={'If-None-Match': app.config['ETAG']})
    same(index.status_code, 304)
    same(query.status_code, 304)
Esempio n. 4
0
def parse_query_splits_queries():
    """The parse_query util links fields to lists of tokens"""
    same(parse_query('class:BAI event affix:bau'),
         {'class': ['BAI'], 'all': ['event'], 'affix': ['bau']})
Esempio n. 5
0
def tex2html_does_typography():
    """The tex2html util handles basic typography"""
    same(tex2html(r'\emph{coi}'), '<em>coi</em>')
    same(tex2html(r'\textbf{coi}'), '<strong>coi</strong>')
Esempio n. 6
0
def braces2links_does_known_words():
    """The braces2links util handles known words"""
    same(braces2links('{coi}', database.root.entries),
         '<a href="coi" title="vocative: greetings/hello.">coi</a>')
Esempio n. 7
0
def compound2affixes_splits_compounds():
    """The compound2affixes util splits compounds into affixes"""
    same(compound2affixes('jbobau'), ['jbo', 'bau'])
    same(compound2affixes('lobybau'), ['lob', 'y', 'bau'])
    same(compound2affixes('jbobangu'), ['jbo', 'bangu'])
    same(compound2affixes('lojbybau'), ['lojb', 'y', 'bau'])
    same(compound2affixes('lobybangu'), ['lob', 'y', 'bangu'])
    same(compound2affixes('lojbybangu'), ['lojb', 'y', 'bangu'])
    same(compound2affixes("ro'inre'o"), ["ro'i", 'n', "re'o"])
Esempio n. 8
0
def tex2html_does_math():
    """The tex2html util handles basic math"""
    same(tex2html('$x_1$'), 'x<sub>1</sub>')
    same(tex2html('$10^2$'), '10<sup>2</sup>')
    same(tex2html('$1*10$'), u'1×10')
Esempio n. 9
0
def sensitive_to_if_none_match_header():
    """Sends a 304 if ETags match"""
    index = client.get('/', headers={'If-None-Match': app.config['ETAG']})
    query = client.get('/coi', headers={'If-None-Match': app.config['ETAG']})
    same(index.status_code, 304)
    same(query.status_code, 304)
Esempio n. 10
0
def parse_query_splits_queries():
    """The parse_query util links fields to lists of tokens"""
    same(parse_query('class:BAI event affix:bau'),
         {'class': ['BAI'], 'all': ['event'], 'affix': ['bau']})
Esempio n. 11
0
def braces2links_does_known_words():
    """The braces2links util handles known words"""
    same(braces2links('{coi}', database.root.entries),
         '<a href="coi" title="vocative: greetings/hello.">coi</a>')
Esempio n. 12
0
def tex2html_does_typography():
    """The tex2html util handles basic typography"""
    same(tex2html(r'\emph{coi}'), '<em>coi</em>')
    same(tex2html(r'\textbf{coi}'), '<strong>coi</strong>')
Esempio n. 13
0
def tex2html_does_math():
    """The tex2html util handles basic math"""
    same(tex2html('$x_1$'), 'x<sub>1</sub>')
    same(tex2html('$10^2$'), '10<sup>2</sup>')
    same(tex2html('$1*10$'), u'1×10')