Skip to content

Commit

Permalink
Add test.py for testing issues and fix issues in nawanshahr/PropertyT…
Browse files Browse the repository at this point in the history
…ax/UsageCategoryDetail.json
  • Loading branch information
tarunlalwani committed Aug 14, 2018
1 parent b15eba9 commit 1281056
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 17 deletions.
34 changes: 17 additions & 17 deletions data/pb/nawanshahr/PropertyTax/UsageCategoryDetail.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,119 +147,119 @@
"code": "POLYTECHNICS",
"UsageCategorySubMinor": "EDUCATIONAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Other Private Educational Institute",
"code": "OTHEREDUCATIONAL",
"UsageCategorySubMinor": "EDUCATIONAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Govt. Aided Educational Institute",
"code": "GOVAIDEDEDUCATIONAL",
"UsageCategorySubMinor": "EDUCATIONAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Others ",
"code": "OTHERINSTITUITIONAL",
"UsageCategorySubMinor": "OTHERINSTITUITIONALSUBMINOR",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Sports Stadium",
"code": "SPORTSSTADIUM",
"UsageCategorySubMinor": "RECREATIONAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Social Club",
"code": "SOCIALCLUB",
"UsageCategorySubMinor": "RECREATIONAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Golf Club ",
"code": "GOLFCLUB",
"UsageCategorySubMinor": "RECREATIONAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Orphanage",
"code": "ORPHANAGE",
"UsageCategorySubMinor": "HOMESFORSPECIALCARE",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Old Age Homes",
"code": "OLDAGEHOMES",
"UsageCategorySubMinor": "HOMESFORSPECIALCARE",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Home for the disabled / destitute",
"code": "DISABLEDHOME",
"UsageCategorySubMinor": "HOMESFORSPECIALCARE",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Stray Animal Care Center",
"code": "ANIMALCARE",
"UsageCategorySubMinor": "HOMESFORSPECIALCARE",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Community Hall",
"code": "COMMUNITYHALL",
"UsageCategorySubMinor": "PUBLICFACILITY",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Govt. Hospital & Dispensary",
"code": "GOVTHOSPITAL",
"UsageCategorySubMinor": "PUBLICFACILITY",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Religious",
"code": "RELIGIOUS",
"UsageCategorySubMinor": "RELIGIOUSINSTITUITION",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Historical Building",
"code": "HISTORICAL",
"UsageCategorySubMinor": "HISTORICAL",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Public Libraries",
"code": "LIBRARIES",
"UsageCategorySubMinor": "PUBLICFACILITY",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
},
{
"name": "Cremation/ Burial Ground",
"code": "CREMATION/BURIAL",
"UsageCategorySubMinor": "PUBLICSPACES",
"active": true,
"fromFY": "2015-16",
"fromFY": "2015-16"
}
]
}
24 changes: 24 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import json
from pathlib import Path
import os

def check_file(file_path):
with open(file_path) as f:
try:
data = json.load(f)
if "tenantId" not in data:
print("tenantId missing in file - " + file_path)
if "moduleName" not in data:
print("moduleName misisng in file - " + file_path)
except Exception as ex:
print(ex)
print("JSON error in file - " + file_path)

for root, dirs, files in os.walk("data"):
for file in files:
if file.endswith(".json"):
file_path = os.path.join(root, file)
check_file(file_path)



0 comments on commit 1281056

Please sign in to comment.