mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from constantly import ValueConstant, Values
|
||||
|
||||
|
||||
class RESULT(Values):
|
||||
OK = ValueConstant(0)
|
||||
FAIL = ValueConstant(-1)
|
||||
|
||||
@classmethod
|
||||
def get(cls, rc):
|
||||
if rc == 0:
|
||||
return cls.OK
|
||||
else:
|
||||
return cls.FAIL
|
||||
|
||||
|
||||
print(list(RESULT.iterconstants()))
|
||||
assert(RESULT.OK < RESULT.FAIL)
|
||||
assert(RESULT.OK.value > RESULT.FAIL.value)
|
||||
assert(RESULT.get(-5) == RESULT.FAIL)
|
||||
Reference in New Issue
Block a user