Commit aaa3826a by Alexander Popov

Use None as state of the options which are not found

That will change the check result
  FAIL: "not found"
onto initial
  FAIL: not found
parent 4b4b6481
...@@ -36,11 +36,17 @@ class Opt: ...@@ -36,11 +36,17 @@ class Opt:
def check(self): def check(self):
global error_count global error_count
# check parsed state against expected state
if self.expected == self.state: if self.expected == self.state:
return True, 'OK' return True, 'OK'
if self.expected == 'is not set' and self.state == 'not found':
return True, 'OK: not found' if self.state is None:
if self.expected == 'is not set':
return True, 'OK: not found'
else:
error_count += 1
return False, 'FAIL: not found'
error_count += 1 error_count += 1
return False, 'FAIL: "' + self.state + '"' return False, 'FAIL: "' + self.state + '"'
...@@ -173,7 +179,7 @@ def print_check_results(): ...@@ -173,7 +179,7 @@ def print_check_results():
def get_option_state(options, name): def get_option_state(options, name):
return options[name] if name in options else 'not found' return options[name] if name in options else None
def check_state(options): def check_state(options):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment