• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gcivil-nyu-org / Wednesday-Fall2023-Team-2 / #9

29 Nov 2023 09:43PM UTC coverage: 91.061% (+5.9%) from 85.196%
#9

push

travis-ci

web-flow
Merge pull request #123 from gcivil-nyu-org/develop

Nov 29 Merge to Production

102 of 123 new or added lines in 11 files covered. (82.93%)

23 existing lines in 3 files now uncovered.

978 of 1074 relevant lines covered (91.06%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/map/scripts/load_parking_lot_data.py
1
import os
1✔
2
import csv
1✔
3
from tqdm import tqdm
1✔
4
from pathlib import Path
1✔
5
from django.db.utils import IntegrityError
1✔
6

7
from ..models import ParkingSpace
1✔
8

9
BASE_DIR = Path(__file__).resolve().parent.parent.parent
1✔
10
csv_file_path = os.path.join(BASE_DIR, "data/concat_result.csv")
1✔
11

12

13
def run():
1✔
14
    print(f"csv file path is: {csv_file_path}")
1✔
15

16
    count = 0
1✔
17
    with open(csv_file_path, "r") as file:
1✔
18
        reader = csv.DictReader(file)
1✔
19
        for row in tqdm(reader):
1✔
20
            try:
1✔
21
                ParkingSpace.objects.create(
1✔
22
                    type=row["type"],
23
                    detail=row["detail"],
24
                    borough=row["borough"],
25
                    latitude=row["latitude"],
26
                    longitude=row["longitude"],
27
                    address_zip=row["address_zip"],
28
                    operation_hours=row["operation_hours"],
29
                    parking_spot_id=row["parking_spot_id"],
30
                    parking_spot_name=row["parking_spot_name"],
31
                )
32
                count += 1
1✔
NEW
33
            except IntegrityError:
×
NEW
34
                print(f"Skipping Parking Space Record[{row['parking_spot_id']}]")
×
35
    print(f"{count} records added!")
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc