def test_blank_around_delimiters(self):
     test_input = ' status = OK , nseverity = 5 , notify = false , a = b '
     test_output = {'color': 'green', 'notify': False}
     assert test_output == parse_metadata(test_input)
 def test_undefined_key(self):
     test_input = 'status=OK,nseverity=5,notify=false,a=b'
     test_output = {'color': 'green', 'notify': False}
     assert test_output == parse_metadata(test_input)
 def test_notify_0(self):
     test_input = 'notify=0'
     test_output = {'color': 'red', 'notify': False}
     assert test_output == parse_metadata(test_input)
 def test_notify_else(self):
     test_input = 'notify=a'
     test_output = {'color': 'red', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_with_status_OK(self):
     test_input = 'status=OK,nseverity=5'
     test_output = {'color': 'green', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_with_status_else(self):
     test_input = 'status=PROBLEM,nseverity=5'
     test_output = {'color': 'red', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_2(self):
     test_input = 'nseverity=2'
     test_output = {'color': 'yellow', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_5(self):
     test_input = 'nseverity=5'
     test_output = {'color': 'red', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_0(self):
     test_input = 'nseverity=0'
     test_output = {'color': 'gray', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_1(self):
     test_input = 'nseverity=1'
     test_output = {'color': 'purple', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_nseverity_with_empty_value(self):
     test_input = 'nseverity='
     test_output = {'color': 'red', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_status_with_small_ok(self):
     test_input = 'status=ok'
     test_output = {'color': 'green', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_status_with_capital_key(self):
     test_input = 'STATUS=OK'
     test_output = {'color': 'green', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_status_with_empty_value(self):
     test_input = 'status='
     test_output = {'color': 'red', 'notify': True}
     assert test_output == parse_metadata(test_input)
 def test_blank_string(self):
     test_input = ''
     test_output = {'color': 'red', 'notify': True}
     assert test_output == parse_metadata(test_input)