Beispiel #1
0
def test_update_attribute():

    sid = sessions.create()
    assert sessions.update_attribute(sid, 'br', {'123': '10/05/2016'})

    value = sessions.get_attribute(sid, 'br')
    assert value['123'] == '10/05/2016'

    assert sessions.update_attribute(sid, 'br', {'123': '11/05/2016'})

    value = sessions.get_attribute(sid, 'br')
    assert value['123'] == '11/05/2016'
Beispiel #2
0
def test_update_attribute():

    sid = sessions.create()
    assert sessions.update_attribute(sid, 'prefs', {'last_seen': '10/05/2016'})

    value = sessions.get_attribute(sid, 'prefs')
    assert value['last_seen'] == '10/05/2016'

    assert sessions.update_attribute(sid, 'prefs', {'last_seen': '11/05/2016'})

    value = sessions.get_attribute(sid, 'prefs')
    assert value['last_seen'] == '11/05/2016'
Beispiel #3
0
def test_delete_session():

    sid = sessions.create()
    data = sessions.get(sid)
    data['prefs'] = {'last_seen': '10/05/2016'}
    assert sessions.update(sid, data)

    data = sessions.get(sid)
    assert data['prefs']['last_seen'] == '10/05/2016'

    assert sessions.destroy(sid)

    data = sessions.get(sid)
    assert data == {}
Beispiel #4
0
def test_delete_session():

    sid = sessions.create()
    data = sessions.get(sid)
    data['br'] = {'123': '10/05/2016'}
    assert sessions.update(sid, data)

    data = sessions.get(sid)
    assert data['br']['123'] == '10/05/2016'

    assert sessions.destroy(sid)

    data = sessions.get(sid)
    assert data == {}
Beispiel #5
0
def test_get_attribute():

    sid = sessions.create()
    data = sessions.get(sid)
    data['prefs'] = {'last_seen': '10/05/2016'}
    assert sessions.update(sid, data)

    data = sessions.get(sid)
    assert data['prefs']['last_seen'] == '10/05/2016'

    value = sessions.get_attribute(sid, 'prefs')
    assert value['last_seen'] == '10/05/2016'

    value = sessions.get_attribute(sid, 'ar')
    assert value is None
Beispiel #6
0
def test_update_session():

    sid = sessions.create()
    data = sessions.get(sid)
    data['br'] = {'123': '10/05/2016'}
    assert sessions.update(sid, data)

    data = sessions.get(sid)
    assert data['br']['123'] == '10/05/2016'

    data['br'] = {'123': '11/05/2016'}
    assert sessions.update(sid, data)

    data = sessions.get(sid)
    assert data['br']['123'] == '11/05/2016'
Beispiel #7
0
def test_get_attribute():

    sid = sessions.create()
    data = sessions.get(sid)
    data['br'] = {'123': '10/05/2016'}
    assert sessions.update(sid, data)

    data = sessions.get(sid)
    assert data['br']['123'] == '10/05/2016'

    value = sessions.get_attribute(sid, 'br')
    assert value['123'] == '10/05/2016'

    value = sessions.get_attribute(sid, 'ar')
    assert value is None
Beispiel #8
0
def test_create_session():

    sid = sessions.create()
    assert isinstance(sid, str) and len(sid) == 36
Beispiel #9
0
def test_get_session():

    sid = sessions.create()
    data = sessions.get(sid)
    assert data == {}
Beispiel #10
0
def test_create_session():

    sid = sessions.create()
    assert type(sid) == str