Here are the examples of the python api mock.sentinel.subnet_id taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
Project: networking-hyperv Source File: test_neutron_client.py
def test_get_network_subnet_cidr(self):
self._neutron._client.show_subnet.return_value = {
'subnet': {
'cidr': self._FAKE_CIDR,
'gateway_ip': self._FAKE_GATEWAY,
}
}
cidr, gw = self._neutron.get_network_subnet_cidr_and_gateway(
mock.sentinel.subnet_id)
self._neutron._client.show_subnet.assert_called_once_with(
mock.sentinel.subnet_id)
self.assertEqual(self._FAKE_CIDR, cidr)
self.assertEqual(self._FAKE_GATEWAY, gw)
3
Example 2
Project: networking-hyperv Source File: test_neutron_client.py
def test_get_network_subnet_cidr_exception(self):
self._neutron._client.show_subnet.side_effect = Exception("Fail")
cidr, gw = self._neutron.get_network_subnet_cidr_and_gateway(
mock.sentinel.subnet_id)
self.assertIsNone(cidr)
self.assertIsNone(gw)