Sha256: 4a01609f3d17a38e148b43bbeb4b1d69179f384b113fd15ed59c9906071e1591

Contents?: true

Size: 1.23 KB

Versions: 27

Compression:

Stored size: 1.23 KB

Contents

require 'fluent/test'
require 'fluent/test/driver/output'
require 'fluent/test/helpers'
require 'fluent/plugin/out_azurestorage_gen2'

require 'test/unit/rr'
require 'zlib'
require 'fileutils'

include Fluent::Test::Helpers

class AzureStorageGen2OutputTest < Test::Unit::TestCase
  def setup
    Fluent::Test.setup
  end

  CONFIG = %[
    azure_storage_account test_storage_account
    azure_storage_access_key dGVzdF9zdG9yYWdlX2FjY2Vzc19rZXk=
    azure_container test_container
    path log
    utc
    buffer_type memory
  ]

  def create_driver(conf = CONFIG)
    Fluent::Test::Driver::Output.new(Fluent::Plugin::AzureStorageGen2Output) do
      # for testing.
      def contents
        @emit_streams
      end

      def write(chunk)
        @emit_streams = []
        event = chunk.read
        @emit_streams << event
      end

      private
      def ensure_container
      end

    end.configure(conf)
  end

  def test_configure
    # TODO write tests
    d = create_driver
    assert_equal 'test_storage_account', d.instance.azure_storage_account
    assert_equal 'dGVzdF9zdG9yYWdlX2FjY2Vzc19rZXk=', d.instance.azure_storage_access_key
    assert_equal 'test_container', d.instance.azure_container
    assert_equal 'log', d.instance.path
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
fluent-plugin-azurestorage-gen2-0.3.9 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.8 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.7 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.5 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.4 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.3 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.2 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.1 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.3.0 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.10 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.9 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.8 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.7 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.6 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.5 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.4 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.3 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.2 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.1 test/plugin/test_out_azurestorage_gen2.rb
fluent-plugin-azurestorage-gen2-0.2.0 test/plugin/test_out_azurestorage_gen2.rb