Sha256: c0b2448e53a7c65a1a279c2007964404731970f71f37e20f48ebaacb2a29a930

Contents?: true

Size: 1.43 KB

Versions: 2

Compression:

Stored size: 1.43 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "globus_client"

Globus::Client.configure(
  client_id: ENV["GLOBUS_CLIENT_ID"],
  client_secret: ENV["GLOBUS_CLIENT_SECRET"],
  uploads_directory: ENV["GLOBUS_UPLOADS_DIRECTORY"],
  transfer_endpoint_id: ENV["GLOBUS_ENDPOINT"]
)

user_id, work_id, work_version = *ARGV

# Test public API methods here.
Globus::Client.mkdir(user_id:, work_id:, work_version:)

user_exists = Globus::Client.user_exists?(user_id)

# Not part of the public API but this allows us to test access changes
before_permissions = Globus::Client::Endpoint.new(Globus::Client.config, user_id: user_id, work_id: work_id, work_version: work_version).send(:access_rule)["permissions"]

files_count = Globus::Client.file_count(user_id:, work_id:, work_version:)

total_size = Globus::Client.total_size(user_id:, work_id:, work_version:)

Globus::Client.disallow_writes(user_id:, work_id:, work_version:)

# Not part of the public API but this allows us to test access changes
after_permissions = Globus::Client::Endpoint.new(Globus::Client.config, user_id: user_id, work_id: work_id, work_version: work_version).send(:access_rule)["permissions"]

puts "User #{user_id} exists: #{user_exists}"
puts "Initial directory permissions: #{before_permissions}"
puts "Number of files in directory: #{files_count}"
puts "Total size of files in directory: #{total_size}"
puts "Final directory permissions: #{after_permissions}"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
globus_client-0.3.2 api_test.rb
globus_client-0.3.1 api_test.rb