📂 Advanced File Manager
Multi-Root Navigation System
⚡ Quick Jump
Server (/)
Home (/home)
Var_www (/var/www)
Current (/home4/shelley/public_html/shelleycutler.com/wp-content/mu-plugins)
📍 Go
⬆ Ke Atas
🏠 Root Server
🏠 Root App
🔄 Refresh
📀 /
›
opt
›
PUC
›
t
›
📁 DataStore
📍
Lokasi:
/opt/PUC/t/DataStore
💾
Free:
45.7 GB
⚠️ Direktori ini
tidak writable
.
✏️ Mengedit: 03-request.t
#!/usr/bin/env perl use strict; use warnings; use FindBin; use Test::More; use Test::Exception; use JSON; use PUC::Collector; ## no critic (ProhibitConstantPragma) use constant CLASS => 'PUC::Collector::DataStore'; use constant KEY_FILE => $FindBin::Bin . '/../../../testdata/etc/collector/puc_datastore_api_key'; use constant POST_DATA => { domain => { name => 'example.com', type => 'main', }, server => { hostname => 'dev.hostgator.com', }, username => 'hgfedcba', webApp => { name => 'wordpress', version => '1.2.3', }, }; use constant DATASTORE_API_PATH => '/v1/report/installed/webapp'; use constant SWAGGER_PATH => '/v1/report/installed/webapp'; ## use critic use_ok CLASS; my $app_config; subtest 'Get PUC::Collector config' => sub { my $bindir = $FindBin::Bin . '/../..'; my $debug = $ENV{TEST_VERBOSE} || 0; my $dryrun = 1; my $dataroot = $FindBin::Bin . '/../../../testdata/'; lives_ok { $app_config = PUC::Collector::parse_config( bindir => $bindir, debug => $debug, dryrun => $dryrun, dataroot => $dataroot, datastore_base_url => 'dryrun://localhost', ); } 'Lives through parsing PUC::Collector config'; $app_config->{datastore_config}->{key_file} = KEY_FILE; }; my $datastore; my $result; lives_ok { $datastore = CLASS->new( %{ $app_config->{datastore_config} } ); $result = $datastore->send_data( ${ \SWAGGER_PATH }, encode_json(POST_DATA) ); } 'Lives through request'; is_deeply { map { $_ => 1 } keys %{ decode_json( $result->{content} ) } }, { map { $_ => 1 } CLASS->SWAGGER_WEBAPP_KEYS }, 'Required keys were transmitted'; like $result->{request_data}->{headers}->{Accept}, qr/json/i, 'Accept header specifies json'; like $result->{request_data}->{headers}->{'X-API-Key'}, qr/INSECURE/i, 'X-API-Key header specifies test key'; like $result->{url}, qr/\Q${\SWAGGER_PATH}\E/x, 'url matches endpoint'; done_testing;
💾 Simpan Perubahan
❌ Batal
📤 Upload
📁 Buat Folder
Nama
Ukuran
Dimodifikasi
Permission
Aksi
📎
01-load.t
197 B
2021-01-29 21:02
0644
✏️ Edit
⬇
✍️
🗑️
📎
03-request.t
2.1 KB
2021-01-29 21:02
0644
✏️ Edit
⬇
✍️
🗑️
✍️ Rename:
Nama Baru:
Batal
💾 Simpan