Changeset 15833 in project


Ignore:
Timestamp:
09/12/09 16:02:11 (10 years ago)
Author:
sjamaan
Message:

Change delete-user to be unregister-user

Location:
release/4/estraier-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/estraier-client/estraier-client.scm

    r15832 r15833  
    4343   list-documents put-document delete-document get-document
    4444   update-attributes document-attribute document-keywords find-documents
    45    delete-user register-admin register-guest
     45   unregister-user register-admin-user register-guest-user
    4646
    4747   master-shutdown master-sync master-backup master-rotate-log
     
    107107         (word-count . ,(string->number (fourth db-info)))
    108108         (size . ,(string->number (fifth db-info)))
    109          (admins . ,admins)
    110          (guests . ,guests))))))
     109         (admin-users . ,admins)
     110         (guest-users . ,guests))))))
    111111
    112112(define (node-cache-usage node)
     
    279279        #f read-lines))
    280280
    281 (define (delete-user node name)
     281(define (unregister-user node name)
    282282  (_set-user node name 0))
    283283
    284 (define (register-admin node name)
     284(define (register-admin-user node name)
    285285  (_set-user node name 1))
    286286
    287 (define (register-guest node name)
     287(define (register-guest-user node name)
    288288  (_set-user node name 2))
    289289
  • release/4/estraier-client/tests/run.scm

    r15831 r15833  
    4444               (map car (master-users master-uri)))))
    4545
    46 ;; TODO: more in-depth tests of result values
     46;; TODO: more in-depth tests of master result values
    4747
    4848(test-group "node API"
     
    5353          0 (alist-ref 'word-count info))
    5454    (test "Node-info reports no guests at first"
    55           '() (alist-ref 'guests info))
     55          '() (alist-ref 'guest-users info))
    5656    (test "Node-info reports no admins at first"
    57           '() (alist-ref 'admins info)))
     57          '() (alist-ref 'admin-users info)))
    5858  (test "Cache usage starts out empty"
    5959        0.0 (node-cache-usage node-uri))
     
    6161        '() (list-documents node-uri))
    6262
    63   (test "After adding admins and a guests, they are listed in node info"
    64         '(("guest1" "guest2") ("admin1" "admin2"))
    65         (begin (register-guest node-uri "guest1")
    66                (register-guest node-uri "guest2")
    67                (register-admin node-uri "admin1")
    68                (register-admin node-uri "admin2")
     63  (test "After registering admins and a guests, they are listed in node info"
     64        '(("guest1" "guest2" "both") ("admin1" "admin2" "both"))
     65        (begin (register-guest-user node-uri "guest1")
     66               (register-guest-user node-uri "guest2")
     67               (register-guest-user node-uri "both")
     68               (register-admin-user node-uri "admin1")
     69               (register-admin-user node-uri "admin2")
     70               (register-admin-user node-uri "both")
    6971               (let ((info (node-info node-uri)))
    70                  (list (alist-ref 'guests info) (alist-ref 'admins info)))))
     72                 (list (alist-ref 'guest-users info)
     73                       (alist-ref 'admin-users info)))))
     74  (test "After unregistering users, they are not listed"
     75        '(("guest2") ("admin2"))
     76        (begin (unregister-user node-uri "guest1")
     77               (unregister-user node-uri "admin1")
     78               (unregister-user node-uri "both")
     79               (let ((info (node-info node-uri)))
     80                 (list (alist-ref 'guest-users info)
     81                       (alist-ref 'admin-users info)))))
    7182 
    7283  (test-error "Putting document without URI is an error"
Note: See TracChangeset for help on using the changeset viewer.