def test_get_hostname(self):
        with patch.object(network.socket, 'gethostname', return_value='A'):
            self.assertEqual(network.get_hostname(), 'A')
Test for Get hostname
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/network_test.py/NetworkTestCase.test_get_hostname