File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 28
28
order = []
29
29
30
30
for post in sortedPostFamily :
31
+ if post ['order' ] == 5 :
32
+ raise Exception ("Order Check Failed! Post {} cannot have order 5!" .format (post ['path' ]))
31
33
order .append (post ['order' ])
32
34
33
35
if order [0 ] != 1 :
34
36
raise Exception ("Order Check Failed! First post does not have order 1!" )
35
37
36
- def checkSequential (l ):
37
- return all (i == j - 1 for i , j in zip (l , l [1 :]))
38
-
39
38
def checkConsecutive (l ):
40
39
return sorted (l ) == list (range (min (l ), max (l )+ 1 ))
41
40
@@ -46,7 +45,4 @@ def checkConsecutive(l):
46
45
except :
47
46
raise Exception ("Order Check Failed! Orders are not consecutive integers!!" )
48
47
49
- if not checkSequential (order ):
50
- raise Exception ("Order Check Failed! Orders are not sequential integers!!" )
51
-
52
48
print ("Order Checks Passed!" )
You can’t perform that action at this time.
0 commit comments