Example #1
0
def read_properties(src):
    return parse_properties_from_multiline_string(read_file(src))
Example #2
0
 def test_must_have_at_least_one_equals_per_line(self):
     expected = {'a':'b', 'c':'4'}
     with self.assertRaises(ValueError) as cm:
      string_utils.parse_properties_from_multiline_string('a=b\nc=4\nbla')
Example #3
0
 def test_must_not_have_more_than_one_equals_per_line(self):
     expected = {'a':'b', 'c':'4'}
     with self.assertRaises(ValueError) as cm:
      string_utils.parse_properties_from_multiline_string('a=b\nc=4\nkey=val=ue')
Example #4
0
 def test_parse_properties_from_multiline_string(self):
     expected = {'a':'b', 'c':'4'}
     self.assertEqual(expected, string_utils.parse_properties_from_multiline_string('a=b\nc=4\n'))