Skip to content

Commit

Permalink
add test case for pgh_st
Browse files Browse the repository at this point in the history
  • Loading branch information
mampfes committed Mar 18, 2021
1 parent 35b8698 commit ef106e3
Showing 1 changed file with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import datetime
import json
import requests
from urllib.parse import quote
from ..helpers import CollectionAppointment

import requests

from ..helpers import CollectionAppointment

DESCRIPTION = "Source for PGH.ST services for the city of Pittsburgh, PA, USA."
URL = "http://www.pgh.st"
TEST_CASES = {}
TEST_CASES = {
"Pittsburgh, Negley": {
"house_number": 800,
"street_name": "Negley",
"zipcode": 15232,
}
}


class Source:
def __init__(self, house_number, street_name, zipcode):
self._house_number = house_number
self._street_name = street_name.replace(".","").strip()
self._street_name = street_name.replace(".", "").strip()
self._zipcode = zipcode

def fetch(self):
Expand All @@ -28,17 +36,26 @@ def fetch(self):
# create entries for trash, recycling, and yard waste
entries = [
CollectionAppointment(
date=datetime.datetime.strptime(data[0]['next_pickup_date'], '%m-%d-%Y').date(),
date=datetime.datetime.strptime(
data[0]["next_pickup_date"], "%m-%d-%Y"
).date(),
t="Trash",
icon="mdi:trash-can"),
icon="mdi:trash-can",
),
CollectionAppointment(
date=datetime.datetime.strptime(data[0]['next_recycling_date'], '%m-%d-%Y').date(),
date=datetime.datetime.strptime(
data[0]["next_recycling_date"], "%m-%d-%Y"
).date(),
t="Recycling",
icon="mdi:recycle"),
icon="mdi:recycle",
),
CollectionAppointment(
date=datetime.datetime.strptime(data[0]['next_yard_date'], '%m-%d-%Y').date(),
date=datetime.datetime.strptime(
data[0]["next_yard_date"], "%m-%d-%Y"
).date(),
t="Yard Waste",
icon="mdi:leaf"),
icon="mdi:leaf",
),
]

return entries

0 comments on commit ef106e3

Please sign in to comment.