@@ -23,19 +23,42 @@ setup() {
2323 [ $( get_models_set_length ' group_set' ) -eq 1 ]
2424}
2525
26- @test " List groups in subgroup in table format" {
26+ @test " List subgroups in a group in table format" {
27+ parent=$( termius group -L ' test group' --port 2 --username ' use r name' )
28+ child=$( termius group -L ' test group' --parent-group $parent --port 2 --username ' use r name' )
29+ run termius groups $parent
30+ [ " $status " -eq 0 ]
31+ [ $( get_models_set_length ' group_set' ) -eq 2 ]
32+ }
33+
34+ @test " List subgroups in a group" {
2735 parent=$( termius group -L ' test group' --port 2 --username ' use r name' )
2836 child=$( termius group -L ' test group' --parent-group $parent --port 2 --username ' use r name' )
2937 run termius groups -f csv -c id $parent
3038 [ " $status " -eq 0 ]
39+ [ " ${lines[1]} " = " $child " ]
40+ [ " ${lines[2]} " = " " ]
3141 [ $( get_models_set_length ' group_set' ) -eq 2 ]
3242}
3343
44+ @test " List subgroups in the root group" {
45+ parent=$( termius group -L ' test group' --port 2 --username ' use r name' )
46+ termius group -L ' test group' --parent-group $parent --port 2 --username ' use r name'
47+ termius group -L ' test group' --parent-group $parent --port 2 --username ' use r name'
48+ run termius groups -f csv -c id
49+ [ " $status " -eq 0 ]
50+ [ " ${lines[1]} " = " $parent " ]
51+ [ " ${lines[2]} " = " " ]
52+ [ $( get_models_set_length ' group_set' ) -eq 3 ]
53+ }
54+
3455@test " List groups recursivly in subgroup in table format" {
3556 grandparent=$( termius group -L ' test group' --port 2 --username ' use r name' )
3657 parent=$( termius group -L ' test group' --parent-group $grandparent --port 2 --username ' use r name' )
3758 termius group -L ' test group' --parent-group $parent --port 2 --username ' use r name'
38- run termius groups $grandparent
59+ run termius groups -f csv -c id $grandparent
3960 [ " $status " -eq 0 ]
61+ [ " ${lines[1]} " = " $parent " ]
62+ [ " ${lines[2]} " = " " ]
4063 [ $( get_models_set_length ' group_set' ) -eq 3 ]
4164}
0 commit comments