Fossil

Check-in [1571e4c2]
Login

Check-in [1571e4c2]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cover simple case of /json/user/save to create a new user. Consider covering various other ways that endpoint can be used, as well as CLI vs GET and POST. Current case is CLI based. This case completes coverage of the basic features provided by all documented JSON endpoints.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rberteig-json-test
Files: files | file ages | folders
SHA1: 1571e4c2781a5a88497242a0dc502c904c21a7e6
User & Date: rberteig 2016-01-30 01:45:32.621
Context
2016-02-02
02:32
Minor tweaks in a few test cases, placeholder for cases to exercise documented error codes. ... (check-in: 9f45c8b6 user: rberteig tags: rberteig-json-test)
2016-01-30
01:45
Cover simple case of /json/user/save to create a new user. Consider covering various other ways that endpoint can be used, as well as CLI vs GET and POST. Current case is CLI based. This case completes coverage of the basic features provided by all documented JSON endpoints. ... (check-in: 1571e4c2 user: rberteig tags: rberteig-json-test)
01:30
Add support for POST in JSON over HTTP. Test /json/cap with various ways of delivering an authToken to cover the rest of the Authentication category basic functionality. NOTE that supplying the authToken in the POSTed JSON request envelope does not appear to work. Passing it in a cookie or in a GET parameter does work as expected. ... (check-in: 479aadb1 user: rberteig tags: rberteig-json-test)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/json.test.
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
test_json_envelope_ok json-tag-add-env
test_json_payload json-tag-add {name value propagate raw appliedTo} {}


# json tag cancel NAME CHECKIN
fossil_json tag add cancel alpha
test_json_envelope_ok json-tag-cancel-env
# BUG? Doc says no payload.
test_json_payload json-tag-cancel {name value propagate raw appliedTo} {}

# json tag find NAME
fossil_json tag find alpha
test_json_envelope_ok json-tag-find-env
test_json_payload json-tag-find {name raw type limit artifacts} {}
test json-tag-find-count {[llength [dict get $JR payload artifacts]] >= 1}







|







422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
test_json_envelope_ok json-tag-add-env
test_json_payload json-tag-add {name value propagate raw appliedTo} {}


# json tag cancel NAME CHECKIN
fossil_json tag add cancel alpha
test_json_envelope_ok json-tag-cancel-env
# DOCBUG? Doc says no payload.
test_json_payload json-tag-cancel {name value propagate raw appliedTo} {}

# json tag find NAME
fossil_json tag find alpha
test_json_envelope_ok json-tag-find-env
test_json_payload json-tag-find {name raw type limit artifacts} {}
test json-tag-find-count {[llength [dict get $JR payload artifacts]] >= 1}
514
515
516
517
518
519
520

521








522
523
524
525
526
527
528
set i 0
foreach u [dict get $JR payload] {
  test_dict_keys json-user-list-$i $u {uid name capabilities info timestamp} {}
  incr i
}

# json user save

test TODO-json-user-save false knownBug









#### WIKI

# wiki list
fossil_json wiki list
test_json_envelope_ok json-wiki-list-env 
set pages  [dict get $JR payload]







>
|
>
>
>
>
>
>
>
>







514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
set i 0
foreach u [dict get $JR payload] {
  test_dict_keys json-user-list-$i $u {uid name capabilities info timestamp} {}
  incr i
}

# json user save
fossil json user save --uid -1 --name U2 --password Utwo 
test_json_envelope_ok json-user-save-env
# DOCBUG? Doc says payload is "same as /json/user/get" but actual
# result was an array of one user similar to /json/user/list.
set i 0
foreach u [dict get $JR payload] {
  test_dict_keys json-user-save-$i $u {uid name capabilities info timestamp} {}
  incr i
}
#test_json_payload json-user-save {uid name capabilities info timestamp} {}

#### WIKI

# wiki list
fossil_json wiki list
test_json_envelope_ok json-wiki-list-env 
set pages  [dict get $JR payload]