File: test_images.rb

package info (click to toggle)
ruby-fog-google 1.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,568 kB
  • sloc: ruby: 16,775; makefile: 3
file content (32 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download | duplicates (4)
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
require "helpers/integration_test_helper"
require "integration/factories/images_factory"

class TestImages < FogIntegrationTest
  include TestCollection

  def setup
    @subject = Fog::Compute[:google].images
    @factory = ImagesFactory.new(namespaced_name)
  end

  def test_get_specific_image
    image = @subject.get(TEST_IMAGE)
    refute_nil(image, "Images.get(#{TEST_IMAGE}) should not return nil")
    assert_equal(image.family, TEST_IMAGE_FAMILY)
    assert_equal(image.project, TEST_IMAGE_PROJECT)
  end

  def test_get_specific_image_from_project
    image = @subject.get(TEST_IMAGE,TEST_IMAGE_PROJECT)
    refute_nil(image, "Images.get(#{TEST_IMAGE}) should not return nil")
    assert_equal(image.family, TEST_IMAGE_FAMILY)
    assert_equal(image.project, TEST_IMAGE_PROJECT)
  end

  def test_get_from_family
    image = @subject.get_from_family(TEST_IMAGE_FAMILY)
    refute_nil(image,"Images.get_from_family(#{TEST_IMAGE_FAMILY}) should not return nil")
    assert_equal(image.family, TEST_IMAGE_FAMILY)
    assert_equal(image.project, TEST_IMAGE_PROJECT)
  end
end