Exemple #1
0
 def test_format_to_variable_value(self):
     assert Shell.format_to_variable_value('text') == 'text'
     assert Shell.format_to_variable_value(True) == 'true'
     assert Shell.format_to_variable_value(False) == 'false'
     assert Shell.format_to_variable_value('42') == '42'
     assert Shell.format_to_variable_value(0) == '0'
     assert Shell.format_to_variable_value(42) == '42'
     assert Shell.format_to_variable_value(None) == ''
     assert Shell.format_to_variable_value(b"42") == '42'
     with raises(KiwiShellVariableValueError):
         Shell.format_to_variable_value(['foo', 'bar'])
Exemple #2
0
 def get_settings(self) -> Dict:
     """
     Return all profile elements that has a value
     """
     profile = {}
     for key, value in list(self.dot_profile.items()):
         profile[key] = Shell.format_to_variable_value(value)
     return collections.OrderedDict(sorted(profile.items()))