예제 #1
0
 def test_fail(self, logger, lxml_objectify):
     # setup
     lxml_objectify.fromstring.side_effect = Exception
     
     # action
     objectified = pt_api.objectify(MagicMock())
     
     # confirm
     self.assertIsNone(objectified)
예제 #2
0
 def test_ok(self, logger, lxml_objectify):
     # action
     objectified = pt_api.objectify(MagicMock())
     
     # confirm
     self.assertEqual(lxml_objectify.fromstring.return_value, objectified)