[tor-bugs] #4913 [Stem]: Add stem.util.conf.Config.save()
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Mon Jan 16 16:34:14 UTC 2012
#4913: Add stem.util.conf.Config.save()
-------------------------+--------------------------------------------------
Reporter: gsathya | Owner: atagar
Type: enhancement | Status: needs_revision
Priority: normal | Milestone:
Component: Stem | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------+--------------------------------------------------
Comment(by atagar):
> with open(self._path, 'w') as f:
Oops, good catch. We still need to rename the 'f' variables too...
> +# moving along..
Cute, though do we really want to push that? ;)
> #Overwrite settings.
Very minor style things but...
- please include a space between the hash and comment
- if your comment is a single sentence then make it all lowercase without
punctuation
examples...
{{{
# the following code will implode and destroy the universe
... or...
# This is a more sizable explanation of said universal doom. More
# specifically, the following code is gonna divide by zero ripping a tear
in
# the space-time continuum... we think. Total galactic destruction has not
yet
# been integration tested.
}}}
Each unit or integration test should be for a single use case of a single
method to make testing failures easier to isolate. Test method names are
of the form "test_<method>_<use case>". In this case you'd probably want
the following new test methods...
# this test would...
# 1. make a config with the example config
# 2. save it to our integ data directory
# 3. clear the config
# 4. load the saved config
# 5. assert that our configuration has the example contents
# 6. remove the config we saved
test_save_example()
# similar to the above, but with an empty configuration file
test_save_empty()
# again similar, but with duplicate keys
test_save_multiple()
Just a suggestion - if you can think of better tests then go for it!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4913#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list