@@ -15,29 +15,21 @@ createDfgSessionIfNotExist(dfg)
15
15
@test Symbol (dfg. userId) in map (u -> u. id, lsUsers (dfg))
16
16
# Test that we can call it again.
17
17
createDfgSessionIfNotExist (dfg)
18
- # And nuke it so we can try the longer functions.
19
- clearUser!! (dfg)
20
18
21
19
# User, robot, and session
22
20
# TODO : Make easier ways to initialize these.
23
21
user = User (Symbol (dfg. userId), " Bob Zack" , " Description" , Dict {Symbol, String} ())
24
22
robot = Robot (Symbol (dfg. robotId), user. id, " Test robot" , " Description" , Dict {Symbol, String} ())
25
23
session = Session (Symbol (dfg. sessionId), robot. id, user. id, " Test Session" , " Description" , Dict {Symbol, String} ())
26
24
27
- # Test errors
28
- dfgError = deepcopy (dfg)
29
- # User/robot/session ID's can't start with numbers and can't have spaces.
30
- dfgError. userId = " 1testNope"
31
- @test_throws Exception createDfgSessionIfNotExist (dfg)
32
-
33
25
@test getUserData (dfg) == Dict {Symbol, String} ()
34
26
@test getRobotData (dfg) == Dict {Symbol, String} ()
35
27
@test getSessionData (dfg) == Dict {Symbol, String} ()
36
28
37
29
# User/robot/session data
38
30
user. data = Dict {Symbol, String} (:a => " Hello" , :b => " Goodbye" )
39
- robot. data = Dict {Symbol, String} (:c => " Hello " , :d => " Goodbye" )
40
- session. data = Dict {Symbol, String} (:e => " Hello " , :f => " Goodbye" )
31
+ robot. data = Dict {Symbol, String} (:c => " ABC " , :d => " Goodbye" )
32
+ session. data = Dict {Symbol, String} (:e => " ADG " , :f => " Goodbye" )
41
33
42
34
setUserData! (dfg, user. data)
43
35
setRobotData! (dfg, robot. data)
@@ -46,6 +38,9 @@ setSessionData!(dfg, session.data)
46
38
@test getRobotData (dfg) == robot. data
47
39
@test getSessionData (dfg) == session. data
48
40
41
+ # And nuke it so we can try the addVariable etc. functions to make sure they create the nodes.
42
+ clearUser!! (dfg)
43
+ createDfgSessionIfNotExist (dfg)
49
44
# Add some nodes.
50
45
v1 = addVariable! (dfg, :a , ContinuousScalar, tags = [:POSE ])
51
46
v2 = addVariable! (dfg, :b , ContinuousScalar, tags = [:POSE ])
@@ -61,3 +56,9 @@ dfgLocal = buildSubgraph(LightDFG, dfg, union(ls(dfg), lsf(dfg)))
61
56
# Confirm that with sentinels we still have the same graph (doesn't pull in the sentinels)
62
57
@test symdiff (ls (dfgLocal), ls (dfg)) == []
63
58
@test symdiff (lsf (dfgLocal), lsf (dfg)) == []
59
+
60
+ # Test errors
61
+ dfgError = deepcopy (dfg)
62
+ # User/robot/session ID's can't start with numbers and can't have spaces.
63
+ dfgError. userId = " I want to fail"
64
+ @test_throws Exception createDfgSessionIfNotExist (dfgError)
0 commit comments