示例#1
0
文件: test_utils.py 项目: yamt/magnum
 def test_convert_to_list_dict(self):
     self.assertIsNone(utils.convert_to_list_dict(None, 'fred'))
     self.assertIsNone(utils.convert_to_list_dict('', 'fred'))
     self.assertEqual([{'fred': 'list'}],
                      utils.convert_to_list_dict('list', 'fred'))
     self.assertEqual([{'fred': 'first'}, {'fred': 'second'}],
                      utils.convert_to_list_dict(['first', 'second'],
                                                 'fred'))
示例#2
0
 def test_convert_to_list_dict(self):
     self.assertIsNone(utils.convert_to_list_dict(None, 'fred'))
     self.assertIsNone(utils.convert_to_list_dict('', 'fred'))
     self.assertEqual([{'fred': 'list'}],
                      utils.convert_to_list_dict('list', 'fred'))
     self.assertEqual([{'fred': 'first'}, {'fred': 'second'}],
                      utils.convert_to_list_dict(['first', 'second'],
                                                 'fred'))