Skip to content

Commit

Permalink
Update council_feature_input_parity.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robbrad authored May 19, 2024
1 parent 1f6b79e commit 53c06fa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion uk_bin_collection/tests/council_feature_input_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ def get_councils_from_files(branch):
url = f"https://api.github.com/repos/robbrad/UKBinCollectionData/contents/uk_bin_collection/uk_bin_collection/councils?ref={branch}"
response = requests.get(url)
data = response.json()
return [item['name'].replace('.py', '') for item in data if item['name'].endswith('.py')]

# Debugging lines to check the response content and type
print(f"Response Status Code: {response.status_code}")
print(f"Response Content: {response.content}")
print(f"Parsed JSON Data: {data}")
print(f"Data Type: {type(data)}")

# Ensure 'data' is a list before proceeding
if isinstance(data, list):
return [item['name'].replace('.py', '') for item in data if item['name'].endswith('.py')]
else:
raise ValueError("Expected a list from the JSON response but got something else.")


def get_councils_from_json(branch):
url = f"https://raw.githubusercontent.com/robbrad/UKBinCollectionData/{branch}/uk_bin_collection/tests/input.json"
Expand Down

0 comments on commit 53c06fa

Please sign in to comment.