def test_return_host_from_resource_id(self): self.assertEqual( "R", remote_node.get_host(etree.fromstring(""" <primitive class="ocf" id="R" provider="pacemaker" type="remote" /> """)) )
def test_return_host_when_there(self): self.assertEqual( "HOST", remote_node.get_host(etree.fromstring(""" <primitive class="ocf" id="R" provider="pacemaker" type="remote" > <instance_attributes> <nvpair name="server" value="HOST"/> </instance_attributes> </primitive> """)) )
def test_return_none_when_host_not_found(self): self.assertIsNone(remote_node.get_host(etree.fromstring(""" <primitive class="ocf" id="R" provider="heartbeat" type="dummy"/> """)))