Skip to content

Commit

Permalink
Fix permissions for real, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
christophhagen committed Feb 18, 2024
1 parent 54175c0 commit 5c3eac9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/NextcloudStatus/JSON/Data/SharesJson.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ extension NextcloudStatusJson.OCS.NextcloudData.Nextcloud {

public let num_fed_shares_received: Int

public let permissions_3_31: Int
public let permissions_3_31: Int?

public let permissions_3_17: Int
public let permissions_3_17: Int?

}
}
Expand Down
7 changes: 7 additions & 0 deletions Tests/NextcloudStatusTests/NextcloudStatusTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ final class NextcloudStatusTests: XCTestCase {
func testEncodeConverted() throws {
try encodeAndCompare(input: nextcloudTestData1)
try encodeAndCompare(input: nextcloudTestData2)
try encodeAndCompare(input: nextcloudTestData3)
}
}

Expand Down Expand Up @@ -271,3 +272,9 @@ private let nextcloudTestData2 =
"""

private let nextcloudTestData3 =

"""
{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":{"nextcloud":{"system":{"version":"27.1.6.2","theme":"","enable_avatars":"yes","enable_previews":"yes","memcache.local":"\\\\OC\\\\Memcache\\\\Redis","memcache.distributed":"none","filelocking.enabled":"yes","memcache.locking":"\\\\OC\\\\Memcache\\\\Redis","debug":"no","freespace":168799322112,"cpuload":[0.1,0.16,0.12],"mem_total":8133632,"mem_free":6948864,"swap_total":0,"swap_free":0,"apps":{"num_installed":44,"num_updates_available":0,"app_updates":[]}},"storage":{"num_users":2,"num_files":8264,"num_storages":5,"num_storages_local":3,"num_storages_home":2,"num_storages_other":0},"shares":{"num_shares":2,"num_shares_user":0,"num_shares_groups":0,"num_shares_link":2,"num_shares_mail":0,"num_shares_room":0,"num_shares_link_no_password":2,"num_fed_shares_sent":0,"num_fed_shares_received":0,"permissions_3_31":2}},"server":{"webserver":"Apache","php":{"version":"8.2.15","memory_limit":536870912,"max_execution_time":3600,"upload_max_filesize":17179869184,"opcache":{"opcache_enabled":true,"cache_full":false,"restart_pending":false,"restart_in_progress":false,"memory_usage":{"used_memory":70573696,"free_memory":62666176,"wasted_memory":977856,"current_wasted_percentage":0.7285594940185547},"interned_strings_usage":{"buffer_size":33554432,"used_memory":13867408,"free_memory":19687024,"number_of_strings":82548},"opcache_statistics":{"num_cached_scripts":1988,"num_cached_keys":3858,"max_cached_keys":16229,"hits":6170704,"start_time":1708184629,"last_restart_time":0,"oom_restarts":0,"hash_restarts":0,"manual_restarts":0,"misses":2044,"blacklist_misses":0,"blacklist_miss_ratio":0,"opcache_hit_rate":99.96688670912857},"jit":{"enabled":false,"on":false,"kind":5,"opt_level":4,"opt_flags":6,"buffer_size":0,"buffer_free":0}},"apcu":[],"extensions":["Core","date","libxml","openssl","pcre","zlib","bcmath","bz2","ctype","curl","dom","hash","fileinfo","filter","ftp","gd","gmp","json","iconv","intl","SPL","ldap","mbstring","pcntl","PDO","session","posix","random","Reflection","standard","SimpleXML","sodium","mysqlnd","exif","sysvsem","tokenizer","xml","xmlreader","xmlwriter","zip","pdo_mysql","cgi-fcgi","redis","Zend OPcache"]},"database":{"type":"mysql","version":"8.0.36","size":"25231360"}},"activeUsers":{"last5minutes":2,"last1hour":2,"last24hours":2}}}}
"""

0 comments on commit 5c3eac9

Please sign in to comment.