コード例 #1
0
ファイル: test_javelin.py プロジェクト: jishandong/tempest
    def test_destroy_subnets(self):

        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user", return_value=self.fake_client))
        fake_subnet_id = self.fake_object["subnet_id"]
        self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name", return_value={"id": fake_subnet_id}))

        javelin.destroy_subnets([self.fake_object])

        mocked_function = self.fake_client.subnets.delete_subnet
        mocked_function.assert_called_once_with(fake_subnet_id)
コード例 #2
0
    def test_destroy_subnets(self):

        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
                                              return_value=self.fake_client))
        fake_subnet_id = self.fake_object['subnet_id']
        self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name",
                                              return_value={
                                                  'id': fake_subnet_id}))

        javelin.destroy_subnets([self.fake_object])

        mocked_function = self.fake_client.networks.delete_subnet
        mocked_function.assert_called_once_with(fake_subnet_id)