def test_create_and_list_networks(self, mock__create_network, mock__list_networks, network_create_args): scenario = network.CreateAndListNetworks(self.context) scenario.run(network_create_args=network_create_args) mock__create_network.assert_called_once_with(network_create_args) mock__list_networks.assert_called_once_with() mock__create_network.reset_mock() mock__list_networks.reset_mock()
def test_create_and_list_networks(self, mock__create_network, mock__list_networks): scenario = network.CreateAndListNetworks(self.context) # Default options network_create_args = {} scenario.run(network_create_args=network_create_args) mock__create_network.assert_called_once_with(network_create_args) mock__list_networks.assert_called_once_with() mock__create_network.reset_mock() mock__list_networks.reset_mock() # Explicit network name is specified network_create_args = {"name": "given-name"} scenario.run(network_create_args=network_create_args) mock__create_network.assert_called_once_with(network_create_args) mock__list_networks.assert_called_once_with()