Exemplo n.º 1
0
 def test_dict2attr(self):
     self.assertEqual(utils.dict2attr(dict()), "")
     self.assertEqual(utils.dict2attr({'key': '1'}), "key=1")
     self.assertEqual(utils.dict2attr(self.attr_dict), self.attr_str)
     self.assertDictEqual(utils.attr2dict(utils.dict2attr(self.attr_dict)),
                          self.attr_dict)
     self.assertEqual(utils.dict2attr(utils.attr2dict(self.attr_str)),
                      self.attr_str)
Exemplo n.º 2
0
 def test_attr2dict(self):
     self.assertDictEqual(utils.attr2dict(""), dict())
     self.assertDictEqual(utils.attr2dict("key=1"), {'key': '1'})
     self.assertDictEqual(utils.attr2dict(self.attr_str), self.attr_dict)
     self.assertDictEqual(utils.attr2dict(utils.dict2attr(self.attr_dict)),
                          self.attr_dict)
     self.assertEqual(utils.dict2attr(utils.attr2dict(self.attr_str)),
                      self.attr_str)
Exemplo n.º 3
0
 def test_dict2attr(self):
     self.assertEqual(utils.dict2attr(dict()), "")
     self.assertEqual(utils.dict2attr({'key':'1'}), "key=1")
     self.assertEqual(utils.dict2attr(self.attr_dict), self.attr_str)
     self.assertDictEqual(utils.attr2dict(utils.dict2attr(self.attr_dict)), self.attr_dict)
     self.assertEqual(utils.dict2attr(utils.attr2dict(self.attr_str)), self.attr_str)
Exemplo n.º 4
0
 def test_attr2dict(self):
     self.assertDictEqual(utils.attr2dict(""), dict())
     self.assertDictEqual(utils.attr2dict("key=1"), {'key':'1'})
     self.assertDictEqual(utils.attr2dict(self.attr_str), self.attr_dict)
     self.assertDictEqual(utils.attr2dict(utils.dict2attr(self.attr_dict)), self.attr_dict)
     self.assertEqual(utils.dict2attr(utils.attr2dict(self.attr_str)), self.attr_str)