Ejemplo n.º 1
0
def cin():
    return Cinemate(
        username='******',
        password='******',
        passkey='PASSKEY',
        apikey='APIKEY',
    )
Ejemplo n.º 2
0
def test_cinemate_wo_params(open_mock, exists_mock, config_content):
    open_mock.return_value = ContextualStringIO(config_content)
    exists_mock.return_value = True
    cin = Cinemate()
    assert cin.username == 'MOCK_USERNAME'
    assert cin.password == 'MOCK_PASSWORD'
    assert cin.passkey == 'MOCK_PASSKEY'
    assert cin.apikey == 'MOCK_APIKEY'
Ejemplo n.º 3
0
# coding=utf-8
""" Пример показывает как использовать следующие методы api:
    * account.auth
    * account.profile
    * account.updatelist
    * account.watchlist
"""
from cinemate import Cinemate


if __name__ == '__main__':
    cin = Cinemate(
        'username',
        'password',
        'passkey',
        'apikey'
    )
    passkey = cin.account.auth()
    profile = cin.account.profile()
    updatelist = cin.account.updatelist()
    watchlist = cin.account.watchlist()
    print(passkey)
    print(profile['username'])
    for update in updatelist:
        if update['new']:
            print(update['date'])
            print(update['date'], update['for_object'])
    for interesting_person in watchlist['person']:
        print(interesting_person)
    for interesting_movie in watchlist['movie']:
        print(interesting_movie)
Ejemplo n.º 4
0
def test_cinemate_raise_wo_params(exists_mock):
    exists_mock.return_value = False
    with pytest.raises(IOError):
        Cinemate()