forked from upyog/upyog-mdms-data
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test.py for testing issues and fix issues in nawanshahr/PropertyT…
…ax/UsageCategoryDetail.json
- Loading branch information
1 parent
b15eba9
commit 1281056
Showing
2 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
||
|