Exemplo 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>')
Exemplo 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"])
Exemplo 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)
Exemplo 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']})
Exemplo 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>')
Exemplo 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>')
Exemplo 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"])
Exemplo 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')
Exemplo 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)
Exemplo 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']})
Exemplo 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>')
Exemplo 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>')
Exemplo 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')