def test_selective_attribute(self): self.maxDiff = None msdp = Msdp(device=self.device) # Set outputs msdp.maker.outputs[ShowIpMsdpPeer] = {'': MsdpOutput.ShowIpMsdpPeer} msdp.maker.outputs[ShowIpMsdpSaCache] = { '': MsdpOutput.ShowIpMsdpSaCache } # Return outputs above as inputs to parser when called self.device.execute = Mock() self.device.execute.side_effect = mapper # Learn the feature msdp.learn() self.assertEqual('Loopback0', msdp.info['vrf']['default']\ ['peer']['10.16.2.2']['connect_source'])
def test_complete_output(self): self.maxDiff = None msdp = Msdp(device=self.device) # Set outputs msdp.maker.outputs[ShowIpMsdpPeer] = {'': MsdpOutput.ShowIpMsdpPeer} msdp.maker.outputs[ShowIpMsdpSaCache] = { '': MsdpOutput.ShowIpMsdpSaCache } # Return outputs above as inputs to parser when called self.device.execute = Mock() self.device.execute.side_effect = mapper # Learn the feature msdp.learn() # Verify Ops was created successfully self.assertEqual(msdp.info, MsdpOutput.MsdpInfo)