Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gems/kubeclient/test/test_persistent_volume_claim.rb')
-rw-r--r--vendor/gems/kubeclient/test/test_persistent_volume_claim.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/gems/kubeclient/test/test_persistent_volume_claim.rb b/vendor/gems/kubeclient/test/test_persistent_volume_claim.rb
new file mode 100644
index 00000000000..e51d8562e60
--- /dev/null
+++ b/vendor/gems/kubeclient/test/test_persistent_volume_claim.rb
@@ -0,0 +1,28 @@
+require_relative 'test_helper'
+
+# PersistentVolumeClaim tests
+class TestPersistentVolumeClaim < MiniTest::Test
+ def test_get_from_json_v1
+ stub_core_api_list
+ stub_request(:get, %r{/persistentvolumeclaims})
+ .to_return(body: open_test_file('persistent_volume_claim.json'), status: 200)
+ client = Kubeclient::Client.new('http://localhost:8080/api/', 'v1')
+ claim = client.get_persistent_volume_claim('myclaim-1', 'default')
+
+ assert_instance_of(Kubeclient::Resource, claim)
+ assert_equal('myclaim-1', claim.metadata.name)
+ assert_equal('3Gi', claim.spec.resources.requests.storage)
+ assert_equal('pv0001', claim.spec.volumeName)
+
+ assert_requested(
+ :get,
+ 'http://localhost:8080/api/v1',
+ times: 1
+ )
+ assert_requested(
+ :get,
+ 'http://localhost:8080/api/v1/namespaces/default/persistentvolumeclaims/myclaim-1',
+ times: 1
+ )
+ end
+end