Beispiel #1
0
def test_get_service_names():
    um = UserManager()
    um.add_provider_by_info('*****@*****.**', 'password', 'Cena', 'John',
                            '04253634223', 'GP')
    assert (um.get_service_names() == ['gp'])
    um.add_provider_by_info('*****@*****.**', 'password', 'Cena', 'John',
                            '04253634223', 'Prac')
    assert (um.get_service_names() == ['gp', 'prac'])
Beispiel #2
0
def test_new_provider_to_existing_service():
    um = UserManager()
    um.add_provider_by_info('*****@*****.**', 'password', 'Cena', 'John',
                            '04253634223', 'GP')
    um.add_provider_by_info('*****@*****.**', 'password', 'Cena', 'John',
                            '04253634223', 'GP')
    assert (um.get_service_names() == ['gp'])
    assert (um.services['gp'] == ['*****@*****.**', '*****@*****.**'])
Beispiel #3
0
def test_remove_existing_patient():
    um = UserManager()
    um.add_patient_by_info('*****@*****.**', 'password', 'Cena', 'John',
                           '04253634223')
    assert (len(um.patients) == 1)
    assert (um.patients[0].email == '*****@*****.**')
    assert (um.get_user('*****@*****.**') is not None)
    assert (um.remove_patient('*****@*****.**'))
    assert (um.patients == [])
    assert (um.get_service_names() == [])