コード例 #1
0
ファイル: test_network.py プロジェクト: joylhx/Rally
    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()
コード例 #2
0
ファイル: test_network.py プロジェクト: zioc/rally
    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()