Skip to content
Snippets Groups Projects
Select Git revision
  • 970e9c13a852e4c78bd7c10e6026eba98d90cfa9
  • stable default protected
  • MA_Pape_2018
  • MA_2018_Lopatin
  • feature/mesh_viewer
  • feature/#468_access_isosurface_scalar
  • feature/#459_default_primitives
  • master protected
  • feature/#470_Create_a_color_lookup_table
  • feature/#473_resize_companion_window
  • feature/#462_do_not_use_arb_extensions
  • feature/#495_Provide_data_for_larger_isosurfaces
  • feature/#323_default_image
  • feature/#480_Create_a_smaller_test_mesh_for_combustion_demo
  • feature/#236_Get_Integration_tests_running_on_CI
  • feature/#447_Copy_standard_assets_to_build_folder
  • 447-copy-standard-assets-to-build-folder-and-remove-resource-path
  • feature/#445_mesh_render_settings_component
  • feature/#251_Make_sure_tests_cpp_is_compiled_once
  • feature/#455_Remove_navigation_and_improve_interaction_for_combustion_demo
  • feature/446_strange_txt_files
  • v18.06.0
  • v18.05.0
  • #251_bad
  • #251_good
  • v18.03.0
  • v18.02.0
  • v18.01.0
  • v17.12.0
  • v17.11.0
  • v17.10.0
  • v17.09.0
  • v17.07.0
33 results

test_generic_material_generator.cpp

Blame
  • service_test.rb 2.78 KiB
    #-------------------------------------------------------------------------
    # # Copyright (c) Microsoft and contributors. All rights reserved.
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #   http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    #--------------------------------------------------------------------------
    require 'test_helper'
    require 'azure/core'
    
    describe 'Azure core service' do
      subject do
        Azure::Core::Service.new
      end
    
      it 'generate_uri should return URI instance' do
        subject.host = 'http://dumyhost.uri'
        subject.generate_uri.must_be_kind_of ::URI
        subject.generate_uri.to_s.must_equal 'http://dumyhost.uri/'
      end
    
      it 'generate_uri should add path to the url' do
        subject.generate_uri('resource/entity/').path.must_equal '/resource/entity/'
      end
    
      it 'generate_uri should correctly join the path if host url contained a path' do
        subject.host = 'http://dummy.uri/host/path'
        subject.generate_uri('resource/entity/').path.must_equal '/host/path/resource/entity/'
      end
    
      it 'generate_uri should encode the keys' do
        subject.generate_uri('', {'key !' => 'value'}).query.must_include 'key+%21=value'
      end
    
      it 'generate_uri should encode the values' do
        subject.generate_uri('', {'key' => 'value !'}).query.must_include 'key=value+%21'
      end
    
      it 'generate_uri should set query string to the encoded result' do
        subject.generate_uri('', {'key' => 'value !', 'key !' => 'value'}).query.must_equal 'key=value+%21&key+%21=value'
      end
    
      it 'generate_uri should override the default timeout' do
        subject.generate_uri('', {'timeout' => 45}).query.must_equal 'timeout=45'
      end
    
      it 'generate_uri should not include any query parameters' do
        subject.generate_uri('', nil).query.must_be_nil
      end
    
      it 'generate_uri should not re-encode path with spaces' do
        subject.host = 'http://dumyhost.uri'
        encoded_path = 'blob%20name%20with%20spaces'
        uri = subject.generate_uri(encoded_path, nil)
        uri.host.must_equal 'dumyhost.uri'
        uri.path.must_equal '/blob%20name%20with%20spaces'
      end
    
      it 'generate_uri should not re-encode path with special characters' do
        subject.host = 'http://dumyhost.uri'
        encoded_path = 'host/path/%D1%84%D0%B1%D0%B0%D1%84.jpg'
        uri = subject.generate_uri(encoded_path, nil)
        uri.host.must_equal 'dumyhost.uri'
        uri.path.must_equal '/host/path/%D1%84%D0%B1%D0%B0%D1%84.jpg'
      end
    end