Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci cd #187

Merged
merged 6 commits into from
Jan 18, 2024
Merged

Ci cd #187

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
494 changes: 109 additions & 385 deletions app_test.py

Large diffs are not rendered by default.

397 changes: 397 additions & 0 deletions app_test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,397 @@
import datetime

DATA_SOURCES_ROWS = [
(
"Calls for Service for Chicago Police Department - IL",
"NULL",
"NULL",
"Calls for Service",
"https://informationportal.igchicago.org/911-calls-for-cpd-service/",
True,
"NULL",
"NULL",
"NULL",
datetime.date(2019, 1, 1),
"NULL",
"NULL",
"Summarized totals",
"NULL",
"NULL",
'["Web page"]',
"NULL",
"NULL",
"NULL",
"Bi-weekly",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"rec00T2YLS2jU7Tbn",
"NULL",
datetime.datetime(2022, 9, 28, 22, 25, 21, tzinfo=datetime.timezone.utc),
datetime.datetime(2023, 11, 8, 19, 6, 38, tzinfo=datetime.timezone.utc),
"NULL",
"NULL",
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"NULL",
"Chicago city, Illinois",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"ok",
"approved",
),
(
"311 Calls for City of Chicago",
"311 Calls for City of Chicago",
"311 Service Requests received by the City of Chicago. This dataset includes requests created after the launch of the new 311 system on 12/18/2018 and some records from the previous system, indicated in the LEGACY\\_RECORD column.\n\nIncluded as a Data Source because in some cities 311 calls lead to police response; that does not appear to be the case in Chicago.\n",
"Calls for Service",
"https://data.cityofchicago.org/Service-Requests/311-Service-Requests/v6vf-nfxy",
False,
"City of Chicago\n",
False,
"NULL",
datetime.date(2018, 12, 18),
"NULL",
datetime.date(2023, 2, 21),
"NULL",
"NULL",
"NULL",
'["Web page", "API", "Download"]',
"NULL",
"Opendata",
'["CSV", "XML", "RDF", "RSS"]',
"NULL",
"NULL",
"NULL",
"NULL",
"City of Chicago\n",
"NULL",
"recUGIoPQbJ6laBmr",
"https://github.com/fgregg/chicagorequests",
datetime.datetime(2023, 2, 21, 15, 19, 25, tzinfo=datetime.timezone.utc),
datetime.datetime(2023, 11, 8, 19, 6, 38, tzinfo=datetime.timezone.utc),
"NULL",
"NULL",
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
datetime.date(2023, 7, 12),
"NULL",
"ok",
"approved",
),
]
DATA_SOURCE_QUERY_RESULTS = [
(
"Calls for Service for Chicago Police Department - IL",
"NULL",
"NULL",
"Calls for Service",
"https://informationportal.igchicago.org/911-calls-for-cpd-service/",
True,
"NULL",
"NULL",
"NULL",
"NULL",
datetime.date(2019, 1, 1),
"NULL",
"NULL",
"NULL",
"Summarized totals",
"NULL",
"NULL",
'["Web page"]',
"NULL",
"NULL",
"Bi-weekly",
"NULL",
"NULL",
"NULL",
"NULL",
datetime.datetime(2022, 9, 28, 22, 25, 21, tzinfo=datetime.timezone.utc),
datetime.datetime(2023, 11, 8, 19, 6, 38, tzinfo=datetime.timezone.utc),
"ok",
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"Chicago city, Illinois",
"NULL",
"approved",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"Chicago Police Department - IL",
),
(
"Officer Involved Shootings for St. Louis (city) Police Department - MO",
"NULL",
"NULL",
"Officer Involved Shootings",
"NULL",
True,
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
datetime.datetime(2022, 9, 28, 22, 25, 30, tzinfo=datetime.timezone.utc),
datetime.datetime(2023, 11, 8, 19, 6, 38, tzinfo=datetime.timezone.utc),
"None found",
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"St. Louis city, Missouri",
"NULL",
"approved",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"St. Louis (city) Police Department - MO",
),
]
DATA_SOURCES_ID_QUERY_RESULTS = (
"Calls for Service for Asheville Police Department - NC",
"NULL",
"NULL",
"Calls for Service",
"https://services.arcgis.com/aJ16ENn1AaqdFlqx/arcgis/rest/services/APD_CAD_911_Calls_2006/FeatureServer/0",
True,
"NULL",
"NULL",
"NULL",
"NULL",
datetime.date(2006, 1, 1),
datetime.date(2006, 12, 31),
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
'["API", "Download"]',
"ArcGIS",
'["GIS / Shapefile"]',
"NULL",
"NULL",
"NULL",
"https://docs.google.com/document/d/143a0LoGwNwmmHxJu1msxjOFAfAXPk7otQSWkrLtUDk0/edit?usp=sharing",
"https://pypi.org/project/openpolicedata/",
datetime.datetime(2023, 3, 2, 18, 36, 27, tzinfo=datetime.timezone.utc),
datetime.datetime(2023, 11, 8, 19, 6, 38, tzinfo=datetime.timezone.utc),
"ok",
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"NULL",
"NULL",
"approved",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"https://www.ashevillenc.gov/department/police",
18,
"law enforcement/police",
"NULL",
"Asheville Police Department",
"local",
"NC",
"Asheville",
"28801",
"37021",
'["Buncombe"]',
35.594677,
-82.54986,
'["recpWxJ9JVa6BtLi5", "reczwxaH31Wf9gRjS", "recBd7NrWsvfTyDk0", "recy24QB6I8FCVrQr", "recW6aQGuNyzedIDl", "recmrXPvQn9Gtfpba", "recsojoTxJ3g08qKl", "recTUW1QUZpsGVxoJ", "reckqhpMEvDgiDGXF", "recjnLeosesVTaW2r", "reccrwbvTL6Ttd8XT", "reckiy2nuY5iRptBm", "recyJMD6eYF9Ln98B", "recLdzmQMXC3XuPWU", "recRNvjKBo5LkUBS9", "recKFoiPMOmWFZvqM", "recordd7DcM3raQF7", "recV35fyFlof4pQXP"]',
"NULL",
datetime.datetime(2023, 5, 16, 17, 37, 6, tzinfo=datetime.timezone.utc),
datetime.date(2023, 3, 2),
True,
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
datetime.datetime(2022, 8, 18, 18, 50, 38, tzinfo=datetime.timezone.utc),
"recrCy8hHYuxC8ZhU",
"NULL",
"reczwxaH31Wf9gRjS",
"recJDGmbd7UMFcfa0",
"Asheville Police Department - NC",
)

QUICK_SEARCH_QUERY_RESULTS = [
(
"rec00T2YLS2jU7Tbn",
"Calls for Service for Chicago Police Department - IL",
"NULL",
"Calls for Service",
"https://informationportal.igchicago.org/911-calls-for-cpd-service/",
"NULL",
datetime.date(2019, 1, 1),
"NULL",
True,
"Chicago Police Department - IL",
"Chicago",
"IL",
),
(
"recUGIoPQbJ6laBmr",
"311 Calls for City of Chicago",
"311 Service Requests received by the City of Chicago. This dataset includes requests created after the launch of the new 311 system on 12/18/2018 and some records from the previous system, indicated in the LEGACY\\_RECORD column.\n\nIncluded as a Data Source because in some cities 311 calls lead to police response; that does not appear to be the case in Chicago.\n",
"Calls for Service",
"https://data.cityofchicago.org/Service-Requests/311-Service-Requests/v6vf-nfxy",
'["CSV", "XML", "RDF", "RSS"]',
datetime.date(2018, 12, 18),
"NULL",
False,
"Chicago Police Department - IL",
"Chicago",
"IL",
),
]

AGENCIES_ROWS = [
(
"Chicago Police Department - IL",
"Chicago Police Department",
"https://home.chicagopolice.org/",
"local",
"IL",
"Chicago",
"17031",
'["Cook"]',
41.85861,
-87.62802,
"NULL",
"recv9fMNEQTbVarj2",
21,
"law enforcement/police",
"NULL",
"60616",
'["recs7gYAGAMWEhLYC", "recyR4IVgqyIekzYB", "recBMxu4UcHCqjsWQ", "recqXzWtmhfV9z8Av", "recc5QWeCMGL17Ab6", "recD9bNxneanhBBDH", "recPUGM4OEopoRAXB", "rec10Mts7CmMPzcnx", "recTj2zTdu7Jp8oX9", "rec00T2YLS2jU7Tbn", "recpOsfsTV4bKmVfa", "recipwTdMN0jRADrt", "recjFk7X0KofjTPGK", "rec0Lqwrj6blSbkuz", "recYyAY8XVQJJVde6", "recgwPuRTwjAMUZeO", "recOLt1yQGlgrO5jQ", "recdAte1fo5FBruE7", "recUGIoPQbJ6laBmr", "recTw75rItd827L0r", "rechI06qD4od759xT", "recodGxvuxiTXPnOL"]',
"NULL",
datetime.datetime(2023, 5, 16, 17, 37, 6, tzinfo=datetime.timezone.utc),
datetime.date(2023, 4, 6),
True,
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"NULL",
datetime.datetime(2022, 8, 18, 18, 50, 7, tzinfo=datetime.timezone.utc),
"recuhY2ud60V41j0w",
),
(
"Pittsburgh Bureau of Police - PA",
"Pittsburgh Bureau of Police",
"http://pittsburghpa.gov/police/",
"local",
"PA",
"Pittsburgh",
"42003",
'["Allegheny"]',
40.450523,
-80.02128,
"NULL",
"recxUlLdt3Wwov6P1",
46,
"law enforcement/police",
"NULL",
"15233",
'["recJK8P5rWlLjSzgc", "recCkota2A2S7Z33q", "recAD4tPHp4IndO2c", "recIwxfj2Ko77ySMD", "recF3bBivp59xdVBW", "recwj8eU8vdTNSEEu", "rec4G2iyEb1UiYfh2", "recJOzE2fe0Srdn4X", "recOlNMNivWF9sumN", "recEFwKevbY7P5DPS", "recvfbfIwGJeKH1OB", "recCvmgUInsKZpP3k", "recrm2fG7gztK7Tfg", "recwHAhLNsz52XvqX", "recX0ez0i7fcDQDx1", "recuvx89h9QZpRSZV", "recEFNJB8aOIF7ucx", "rec8ILhFGC9694CMS", "rec3Oc64eiYe0Cphx", "recLsGQ6yBEvJXTc3", "recRIejFKCgQgsX3l", "recd4qlLMmoLb4Rds", "recmhO1J5gh9pzgUP", "recJ46NmxuyjkoonW", "recmMakoz1eKO6rdC", "recAGF2VxFsOSZHqb", "recBSLCZXuVj1Zy0R", "recV3HCVPrqP31sqp", "rec1LIccYrPQVAdgL", "recgyEBNyh7VNyrAH", "recBjOdBK3XuSCTZy", "recUIXIJKuWleztqy", "recw9GbEslgN5w6zt", "recSQKpHfaj15B249", "recjeyUxVgQh2gqUj", "recbv6UOuUesjrXgI", "rec5E9yiFbuY3dWEc", "recFcv4IvAkcrlTdF", "recP5qX2qNlsuv7Np", "reckDUGoOgKx3yjqf", "rectnkXtlHLV26ZQP", "recrVIpgDHsFbB8Jn", "receW1cbs1sDMQvRl", "recQY7IEhVIIFL7wv", "recsIealZCldEKOlX", "rec7OiCCI6XxDy6ti", "rec2doMHsYVl5i6Y7", "rec8zJuEOvhAZCfAD", "recORxPfDzvYoBO4E", "recwDqMgD47XqrkbK", "rec40yyKK0f5lua4Z"]',
"NULL",
datetime.datetime(2023, 3, 23, 18, 0, 3, tzinfo=datetime.timezone.utc),
datetime.date(2023, 11, 3),
True,
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"NULL",
datetime.datetime(2022, 8, 18, 18, 49, 27, tzinfo=datetime.timezone.utc),
"recACF0SHugE9icVH",
),
(
"Philadelphia Police Department - PA",
"Philadelphia Police Department",
"https://www.phillypolice.com/districts/22nd/index.html",
"local",
"PA",
"Philadelphia",
"42101",
'["Philadelphia"]',
39.980556,
-75.16209,
"NULL",
"recRvBpZqXM8mjddz",
17,
"law enforcement/police",
"NULL",
"19121",
'["recXlFbG4J6pkBdKn", "recHd6j7LT6iMWWzf", "rec7IloZhaAsjpGwt", "recnKS6MwvODb4okj", "recgsrvT60fwJK2zv", "rec8gO2K86yk9mQIU", "recsvkVLs3NHh6fEk", "recIWjgyMq9umFWdv", "recIZvrJ1JJQddfGP", "recVcjF6jZJ7bkujw", "rec8r19ChbuSwpSpJ", "recPSQHatnNFV7H29", "recNH6V5a4TpINhMj", "recwbcrNqdutfgrE7", "rec5RlBXnQOEpGJQz", "recAbsBlvWEsCifvz", "recanjxF6Ph3SNA5P", "recX4kQbeRFch59DU", "recpqSEq8bYcNvIv9", "recVyLpoO48utQuq6"]',
"NULL",
datetime.datetime(2023, 5, 16, 17, 37, 6, tzinfo=datetime.timezone.utc),
datetime.date(2023, 5, 2),
True,
"NULL",
'{"id": "usrtLIB4Vr3jTH8Ro", "email": "[email protected]", "name": "Josh Chamberlain"}',
"NULL",
datetime.datetime(2022, 8, 18, 18, 50, 49, tzinfo=datetime.timezone.utc),
"rec6tZ0VTIMmKXCkH",
),
]

ARCHIVES_GET_QUERY_RESULTS = [
(
"rec00T2YLS2jU7Tbn",
"https://informationportal.igchicago.org/911-calls-for-cpd-service/",
"Bi-weekly",
"NULL",
"Chicago Police Department - IL",
),
(
"rec04V1oMa6Dxt0Sl",
"https://www.columbus.gov/police-annualreports/",
"Annually",
datetime.date(2023, 9, 16),
"Columbus Division of Police - OH",
),
]
Loading