-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
40 lines (36 loc) · 1.08 KB
/
tests.py
File metadata and controls
40 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from db import *
# Test the function with parameters
if __name__ == "__main__":
neighborhood = 'Kips Bay'
price = 2500
bedrooms = 2.0
bathrooms = 1.5
include_no_fee = False
results = get_matching_users(
neighborhood,
price,
bedrooms,
bathrooms,
include_no_fee
)
print(results)
# Test upsert_listings with example data
# example_listing = {
# "listing_id": "12345",
# "address": "123 Main St",
# "link": "http://example.com",
# "price": 2500.00,
# "neighborhood": "Example Neighborhood",
# "property_type": "Rental Unit",
# "bedrooms": 2,
# "bathrooms": 1.5,
# "first_image_link": "http://example.com/image.jpg",
# "no_fee": True,
# "listing_agency": "Example Agency",
# "geographical_coordinates": "40.7128,-74.0060",
# "timestamp": datetime.now(timezone.utc)
# }
#
# added, existing = upsert_listings([example_listing])
# print(f"Added listings: {added}")
# print(f"Existing listings: {existing}")