Beispiel #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'])
Beispiel #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'])