Skip to content

Commit 498fd23

Browse files
committed
Additional validation.
* Ensure PID directories only have an index.md * Ensure PIDs are valid hex.
1 parent b2de95c commit 498fd23

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
File renamed without changes.
File renamed without changes.

test/validate_pids.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515

1616
ok = True
1717

18+
for index in vid_1209.glob("*/*"):
19+
if index.name != "index.md":
20+
ok = False
21+
print("Invalid file:", index)
22+
1823
for pid in vid_1209.iterdir():
1924
pid = pid.name
2025
if pid == "index.md":
2126
continue
27+
try:
28+
int(pid, 16)
29+
except ValueError:
30+
ok = False
31+
print("PID " + pid + " not valid hex. Must be 4 characters 0-9 or A-F.")
2232
if pid.upper() != pid:
2333
ok = False
2434
print("PID must be upper case:", pid)

0 commit comments

Comments
 (0)