Exemplo n.º 1
0
def test_claim(db):
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    db.haiku.update.assert_called_with({'message': u'unicode snowman ☃'},
                                       {'$set': {
                                           'author': 'me'
                                       }})
    assert resp == u'me has claimed the line: unicode snowman ☃'
Exemplo n.º 2
0
def test_claim_unknown_line(db):
    db.haiku.update.side_effect = Exception
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    assert resp == "Sorry, I don't know that line."
Exemplo n.º 3
0
def test_claim(db):
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    db.haiku.update.assert_called_with({'message': u'unicode snowman ☃'},
                                       {'$set': {'author': 'me'}})
    assert resp == u'me has claimed the line: unicode snowman ☃'
Exemplo n.º 4
0
def test_claim_unknown_line(db):
    db.haiku.update.side_effect = Exception
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    assert resp == "Sorry, I don't know that line."