Beispiel #1
0
def test_member_authenticate_fail(HttpMock):
    client = init_client()
    test_username = '******'
    test_password = get_random_md5()

    content = """<?xml version="1.0" encoding="utf-8"?>
                    <responsemember>
                    <error>
                        <code>6</code>
                        <description>Invalid Login Details</description>
                    </error>
                 </responsemember>"""

    http = build_http_mock(HttpMock, content=content)
    member = Member.authenticate(test_username, test_password, client)
Beispiel #2
0
def test_member_authenticate_fail(HttpMock):
    client = init_client()
    test_username = '******'
    test_password = get_random_md5()

    content = """<?xml version="1.0" encoding="utf-8"?>
                    <responsemember>
                    <error>
                        <code>6</code>
                        <description>Invalid Login Details</description>
                    </error>
                 </responsemember>"""

    http = build_http_mock(HttpMock, content=content)
    member = Member.authenticate(test_username, test_password, client)
Beispiel #3
0
def test_member_authenticate(HttpMock):
    client = init_client()
    test_member_id = get_random_md5()
    test_username = '******'
    test_password = get_random_md5()
    test_firstname = 'first'
    test_lastname = 'last'
    test_email = '*****@*****.**'

    content = """<?xml version="1.0" encoding="utf-8"?>
                 <ResponseMember>
                    <memberaccount id="%(test_member_id)s">
                        <username>%(test_username)s</username>
                        <firstname>%(test_firstname)s</firstname>
                        <lastname>%(test_lastname)s</lastname>
                        <email>%(test_email)s</email>
                    </memberaccount>
                </ResponseMember>""" % locals()

    http = build_http_mock(HttpMock, content=content)
    member = Member.authenticate(test_username, test_password, client)
    assert member.id == test_member_id
Beispiel #4
0
def test_member_authenticate(HttpMock):
    client = init_client()
    test_member_id = get_random_md5()
    test_username = '******'
    test_password = get_random_md5()
    test_firstname = 'first'
    test_lastname = 'last'
    test_email = '*****@*****.**'

    content = """<?xml version="1.0" encoding="utf-8"?>
                 <ResponseMember>
                    <memberaccount id="%(test_member_id)s">
                        <username>%(test_username)s</username>
                        <firstname>%(test_firstname)s</firstname>
                        <lastname>%(test_lastname)s</lastname>
                        <email>%(test_email)s</email>
                    </memberaccount>
                </ResponseMember>""" % locals()

    http = build_http_mock(HttpMock, content=content)
    member = Member.authenticate(test_username, test_password, client)
    assert member.id == test_member_id
Beispiel #5
0
from harvestmedia.api.config import Config
from harvestmedia.api.client import Client
from harvestmedia.api.member import Member

api_key = 'e1d5d645d2d984e499e816a7a314dfbd610149f124c3373455c37ad75ab3ffccf444a04a10953b62'
webservice_url = 'https://service.harvestmedia.net/HMP-WS.svc'

client = Client(api_key=api_key, debug_level='DEBUG')

#member = Member(client)
#member.username = '******'
#member.email = '*****@*****.**'
#member.firstname = 'Ryan1'
#member.lastname = 'Roemmich1'
#member.create()

#member = Member(client)
#member.send_password('test')

member = Member(client)
authenticated = member.authenticate('test', 'test', client)
print authenticated

playlists = member.get_playlists()

for playlist in playlists:
    print playlist.id + ': ' + playlist.name