systemconfig.GetMacAddresses

Here are the examples of the python api systemconfig.GetMacAddresses taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

Example 1

Project: macops Source File: systemconfig_test.py
  @mock.patch.object(systemconfig, 'GetDot1xInterfaces')
  def testGetMacAddressesWhenMultipleAreFound(self, mock_gd1i):
    """Test GetMacAddresses when multiple are found."""
    mock_gd1i.return_value = [{'mac': 'ab:cd:ef:gh'},
                              {'mac': 'ij:kl:mn:op'}]
    self.assertEqual(['ABCDEFGH', 'IJKLMNOP'], systemconfig.GetMacAddresses())

Example 2

Project: macops Source File: systemconfig_test.py
  @mock.patch.object(systemconfig, 'GetDot1xInterfaces')
  def testGetMacAddressesWhenOneFound(self, mock_gd1i):
    """Test GetMacAddresses when one is found."""
    mock_gd1i.return_value = [{'mac': 'ab:cd:ef:gh'}]
    self.assertEqual(['ABCDEFGH'], systemconfig.GetMacAddresses())

Example 3

Project: macops Source File: systemconfig_test.py
  @mock.patch.object(systemconfig, 'GetDot1xInterfaces')
  def testGetMacAddressesWhenNoneFound(self, mock_gd1i):
    """Test GetMacAddresses with none found."""
    mock_gd1i.return_value = []
    self.assertEqual([], systemconfig.GetMacAddresses())