File: virtual_machine_extension_images_spec.rb

package info (click to toggle)
ruby-azure-sdk 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,400 kB
  • ctags: 12,388
  • sloc: ruby: 168,299; sh: 6; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

require_relative 'spec_helper'

include MsRestAzure
include Azure::ARM::Compute

describe VirtualMachineExtensionImages do
  before(:each) do
    @resource_helper = ResourceHelper.new
    @location = 'westus'
    @publisher_name = 'Microsoft.WindowsAzure.Compute'
    @type = 'AzureLogCollector'
    @version = '1.0.0.7'
    @client = @resource_helper.compute_client.virtual_machine_extension_images
  end

  it 'should list virtual machine extension image types' do
    result = @client.list_types_async(@location, @publisher_name).value!
    expect(result.response.status).to eq(200)
    expect(result.body).not_to be_nil
    expect(result.body).to be_a Array
  end

  it 'should list virtual machine extension image versions' do
    result = @client.list_versions_async(@location, @publisher_name, @type).value!
    expect(result.response.status).to eq(200)
    expect(result.body).not_to be_nil
    expect(result.body).to be_a Array
  end

  it 'should list virtual machine extension image versions with filters and top' do
    filter = "startswith(name,'1.1')"
    orderby = 'name'
    result = @client.list_versions_async(@location, @publisher_name, @type, filter, 1, orderby).value!
    expect(result.response.status).to eq(200)
    expect(result.body).not_to be_nil
    expect(result.body).to be_a Array
  end

  it 'should get virtual machine extension image' do
    result = @client.get_async(@location, @publisher_name, @type, @version).value!
    expect(result.response.status).to eq(200)
    expect(result.body).not_to be_nil
  end
end