Skip to content

Commit

Permalink
Fix error PENDING not in list (#150)
Browse files Browse the repository at this point in the history
* Fix error "PENDING not in list"

* Add test
  • Loading branch information
MasloMaslane authored Oct 18, 2023
1 parent 0f68187 commit df1cbf2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sinol_make/commands/run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def colorize_status(status):


def update_group_status(group_status, new_status):
order = [Status.CE, Status.TL, Status.ML, Status.RE, Status.WA, Status.OK]
order = [Status.CE, Status.TL, Status.ML, Status.RE, Status.WA, Status.OK, Status.PENDING]
if order.index(new_status) < order.index(group_status):
return new_status
return group_status
Expand Down
9 changes: 9 additions & 0 deletions tests/commands/run/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,12 @@ def test_get_valid_input_files(create_package):
assert len(valid_inputs) == len(outputs) - 1
assert "in/" + os.path.basename(outputs[0].replace(".out", ".in")) not in valid_inputs
assert "in/" + os.path.basename(outputs[1].replace(".out", ".in")) in valid_inputs


def test_update_group_status():
from sinol_make.commands.run import update_group_status
assert update_group_status(Status.OK, Status.WA) == Status.WA
assert update_group_status(Status.PENDING, Status.OK) == Status.OK
assert update_group_status(Status.PENDING, Status.WA) == Status.WA
assert update_group_status(Status.WA, Status.CE) == Status.CE
assert update_group_status(Status.CE, Status.WA) == Status.CE

0 comments on commit df1cbf2

Please sign in to comment.