# Path: eldonationtracker/api/donor.py
# class Donor:
#     def __init__(self, json):
#     def name(self) -> str:
#     def donor_id(self) -> str:
#     def image_url(self) -> str:
#     def amount(self) -> float:
#     def number_of_donations(self) -> str:
#     def json_to_attributes(json_values):
#     def __lt__(self, other):
#     def __eq__(self, other):
#     def __str__(self):


from eldonationtracker.api import donor

def test_donor_attributes_none_missing():
    donor1_json = {"displayName": "donor1", "sumDonations": "45", "donorID": 1000111,
                   'avatarImageURL': "http://someplace.com/image.jpg", "numDonations": 2}
    donor1 = donor.Donor(donor1_json)
    assert donor1.name == "donor1"
    assert donor1.donor_id == 1000111
    assert donor1.image_url == "http://someplace.com/image.jpg"
    assert donor1.amount == 45
    assert donor1.number_of_donations == 2


def test_donor_attributes_name_missing():
    donor1_json = {"sumDonations": "45", "donorID": 1000111,
                   'avatarImageURL': "http://someplace.com/image.jpg", "numDonations": 2}
    donor1 = donor.Donor(donor1_json)
    assert donor1.name == "Anonymous"
    assert donor1.donor_id == 1000111
    assert donor1.image_url == "http://someplace.com/image.jpg"
    assert donor1.amount == 45
    assert donor1.number_of_donations == 2


def test_donor_lt_whole_numbers():
    """Test to make sure comparison works.

    Uses whole dollar amounts.
    """
    donor1_json = {"displayName": "donor1", "sumDonations": "45"}
    donor2_json = {"displayName": "donor2", "sumDonations": "30"}

# Path: eldonationtracker/api/donor.py
# class Donor:
#     def __init__(self, json):
#     def name(self) -> str:
#     def donor_id(self) -> str:
#     def image_url(self) -> str:
#     def amount(self) -> float:
#     def number_of_donations(self) -> str:
#     def json_to_attributes(json_values):
#     def __lt__(self, other):
#     def __eq__(self, other):
#     def __str__(self):


# Path: eldonationtracker/tests/test_donor.py
from eldonationtracker.api import donor


def test_donor_attributes_none_missing():
    donor1_json = {"displayName": "donor1", "sumDonations": "45", "donorID": 1000111,
                   'avatarImageURL': "http://someplace.com/image.jpg", "numDonations": 2}
    donor1 = donor.Donor(donor1_json)
    assert donor1.name == "donor1"
    assert donor1.donor_id == 1000111
    assert donor1.image_url == "http://someplace.com/image.jpg"
    assert donor1.amount == 45
    assert donor1.number_of_donations == 2


def test_donor_attributes_name_missing():
    donor1_json = {"sumDonations": "45", "donorID": 1000111,
                   'avatarImageURL': "http://someplace.com/image.jpg", "numDonations": 2}
    donor1 = donor.Donor(donor1_json)
    assert donor1.name == "Anonymous"
    assert donor1.donor_id == 1000111
    assert donor1.image_url == "http://someplace.com/image.jpg"
    assert donor1.amount == 45
    assert donor1.number_of_donations == 2


def test_donor_lt_whole_numbers():
    """Test to make sure comparison works.

    Uses whole dollar amounts.
    """
    donor1_json = {"displayName": "donor1", "sumDonations": "45"}
    donor2_json = {"displayName": "donor2", "sumDonations": "30"}

    donor1 = donor.Donor(donor1_json)