예제 #1
0
 def test_format_field_with_tabs(self):
     s = AnkiCard.format_field("str\twith\ttabs")
     assert_equal(s, '"str\twith\ttabs"')
예제 #2
0
 def test_format_field_with_quotes(self):
     s = AnkiCard.format_field('str "with" quotes')
     assert_equal(s, "str "with" quotes")
예제 #3
0
 def test_format_field_with_latex_option(self):
     s = AnkiCard.format_field("\\superlatex{tag}", format="latex")
     assert_equal(s, "[latex]\\superlatex{tag}[/latex]")
예제 #4
0
 def test_generate(self):
     c = AnkiCard(["Question?", '\\supertex{tag}\t"bougle"\n\\bigle{}'])
     s = c.generate(format="latex")
     expected = '[latex]Question?[/latex]\t"[latex]\\supertex{tag}\t"bougle"\n\\bigle{}[/latex]"'
     assert_equal(s, expected)
예제 #5
0
 def test_format_field_with_newlines(self):
     s = AnkiCard.format_field("str\nwith\nnewlines")
     assert_equal(s, '"str\nwith\nnewlines"')