Esempio n. 1
0
def testManyMultiLineQuestionLines():

    q = AnkiQuestion("Capital Cities\nCapital of dublin")
    q.addQuestion("Second line")
    q.addAnswer("Dublin")
    deck = AnkiDeck("Capitals")
    deck.addQuestion(q)

    a = AnkiNoteBuilder()
    noteData = a.buildNote(deck.getQuestions()[0])

    assert (noteData["fields"]["Front"] ==
            "Capital Cities<br>Capital of dublin <br>Second line <br>")
Esempio n. 2
0
def testMultiLineQuestion():

    data = ["* Question line 1","* Question line 2","** Answer"]
    deckBuilder = DeckBuilder()
    deck = deckBuilder.buildDeck(data, "test Deck", "")

    expectedQuestion = AnkiQuestion()
    q1 = AnkiQuestion("What is the capital of Ireland")
    expectedQuestion.addQuestion("Question line 1")
    expectedQuestion.addQuestion("Question line 2")
    expectedQuestion.addAnswer("Answer")

    assert(deck.getQuestions()[0].question == expectedQuestion.question)
    assert(deck.getQuestions()[0]._answers == expectedQuestion._answers)