File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 22
33## 1.0
44
5+ * Stanza.submit now takes a dictionary of key/value pairs specifying the stanza instead of a raw string.
56* Namespace handling has changed subtly. Code that depends on namespace handling in detail may break.
67* Added User.role_entities to return a list of the actual entity objects for the
78 roles of a user. User.roles still returns a list of the role names.
Original file line number Diff line number Diff line change @@ -1680,11 +1680,11 @@ class Stanza(Entity):
16801680 def submit (self , stanza ):
16811681 """Populates a stanza in a given configuration file. #FRED? Thought KV pairs would be what you provide, not a single name.
16821682
1683- :param stanza: The name of the stanza.
1684- :type stanza: ``string ``
1685- :return: The new :class:`Stanza` object.
1683+ :param stanza: A dictionary of key/value pairs to set in this stanza.
1684+ :type stanza: ``dict ``
1685+ :return: The :class:`Stanza` object this method is called on .
16861686 """
1687- self .service .request (self .path , method = "POST" , body = stanza )
1687+ self .service .post (self .path , ** stanza )
16881688 return self
16891689
16901690 def __len__ (self ):
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ def setUp(self):
5050
5151 def tearDown (self ):
5252 self .service .apps .delete (self .app_name )
53+ self .clear_restart_message ()
5354
5455 def test_confs (self ):
5556 confs = self .app_service .confs
@@ -83,6 +84,14 @@ def test_confs(self):
8384 self .assertEqual (len (stanza ), 1 )
8485 self .assertTrue (key in stanza )
8586
87+ values = {testlib .tmpname (): testlib .tmpname (),
88+ testlib .tmpname (): testlib .tmpname ()}
89+ stanza .submit (values )
90+ stanza .refresh ()
91+ for key , value in values .iteritems ():
92+ self .assertTrue (key in stanza )
93+ self .assertEqual (value , stanza [key ])
94+
8695 count = len (conf )
8796 conf .delete (stanza_name )
8897 self .assertFalse (stanza_name in conf )
You can’t perform that action at this time.
0 commit comments