예제 #1
0
def test_note_with_cloze_number_and_hint():
    assert parse_roam_block('{c0|content|hint}') == [
        Cloze(['content'], 'hint', number=0)
    ]
예제 #2
0
def test_simple_note_with_hint():
    assert parse_roam_block('{content|hint}') == [Cloze(['content'], 'hint')]
예제 #3
0
def test_note_with_cloze_number():
    assert parse_roam_block('{c0|content}') == [Cloze(['content'], number=0)]
예제 #4
0
def test_code_block():
    assert parse_roam_block('```{code}```') == [CodeBlock('{code}')]
예제 #5
0
def test_simple_note_with_newline():
    assert parse_roam_block('{con\ntent}') == [Cloze(['con\ntent'])]
예제 #6
0
def test_parse_math_part():
    assert parse_roam_block(r'$$\textrm{math}$$') == [Math(r'\textrm{math}')]
예제 #7
0
def test_parse_cloze_containing_code_block():
    parts = parse_roam_block('{```co``de```}')
    assert parts == [Cloze([CodeBlock('co``de')])]
예제 #8
0
def test_colon_command_with_curly_brackets():
    assert parse_roam_block(':hiccup {text}') == [
        RoamColonCommand('hiccup', ' {text}')
    ]
예제 #9
0
def test_colon_command_with_space_after():
    text = ': hiccup text'
    assert parse_roam_block(text) == [text]
예제 #10
0
def test_simple_note_with_malformed_double_brackets():
    assert parse_roam_block('{ {content}}') == ['{ {content}}']
예제 #11
0
def test_simple_note_with_single_brackets_inside_double_brackets():
    text = ' query: {and: [[TODO]]} '
    assert parse_roam_block('{{' + text + '}}') == [RoamCurlyCommand(text)]
예제 #12
0
def test_simple_note_with_double_brackets():
    assert parse_roam_block('{{content}}') == [RoamCurlyCommand('content')]
예제 #13
0
def test_parse_cloze():
    assert parse_roam_block('{cloze}') == [Cloze(['cloze'])]
예제 #14
0
def test_parse_string():
    assert parse_roam_block('text') == ['text']
예제 #15
0
def test_note_with_cloze_then_text():
    assert parse_roam_block('{c1|content} text') == [
        Cloze(['content'], number=1), ' text'
    ]
예제 #16
0
def test_colon_command_with_non_whitespace_text_immediately_after():
    assert parse_roam_block(':hiccuptext') == [
        RoamColonCommand('hiccup', 'text')
    ]
예제 #17
0
def test_note_with_text_then_cloze():
    assert parse_roam_block('text{c1|content}') == [
        'text', Cloze(['content'], number=1)
    ]
예제 #18
0
def test_code_inline():
    assert parse_roam_block('`{code}`') == [CodeInline('{code}')]
예제 #19
0
def test_parse_cloze_containing_math():
    parts = parse_roam_block(r'{$$\textrm{math}$$}')
    assert parts == [Cloze([Math(r'\textrm{math}')])]
예제 #20
0
def test_parse_cloze_containing_code_inline():
    parts = parse_roam_block('{`code``code`}')
    assert parts == [Cloze([CodeInline('code'), CodeInline('code')])]