Exemplo n.º 1
0
    def test_get_macs(self):
        '''
            Test to return a list off MAC addresses from the named vm
        '''
        mock = MagicMock(side_effect=[None, ["a", "b", "c"]])
        with patch.object(xapi, "get_nics", mock):
            self.assertIsNone(xapi.get_macs("salt"))

            self.assertListEqual(xapi.get_macs("salt"), ['a', 'b', 'c'])
Exemplo n.º 2
0
    def test_get_macs(self):
        '''
            Test to return a list off MAC addresses from the named vm
        '''
        mock = MagicMock(side_effect=[None, ["a", "b", "c"]])
        with patch.object(xapi, "get_nics", mock):
            self.assertIsNone(xapi.get_macs("salt"))

            self.assertListEqual(xapi.get_macs("salt"), ['a', 'b', 'c'])