def test_get_bufsize(self): ''' Test for return network buffer sizes as a dict ''' with patch.dict(network.__grains__, {'kernel': 'Linux'}): with patch.object(os.path, 'exists', return_value=True): with patch.object(network, '_get_bufsize_linux', return_value={'size': 1}): self.assertDictEqual(network.get_bufsize('iface'), {'size': 1}) with patch.dict(network.__grains__, {'kernel': 'A'}): self.assertDictEqual(network.get_bufsize('iface'), {})
def test_get_bufsize(self): """ Test for return network buffer sizes as a dict """ with patch.dict(network.__grains__, {"kernel": "Linux"}): with patch.object(os.path, "exists", return_value=True): with patch.object( network, "_get_bufsize_linux", return_value={"size": 1} ): self.assertDictEqual(network.get_bufsize("iface"), {"size": 1}) with patch.dict(network.__grains__, {"kernel": "A"}): self.assertDictEqual(network.get_bufsize("iface"), {})