Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (44 sloc) 1.489 kB

Nova Client Style Commandments

Nova Client Specific Commandments

None so far

Text encoding

  • All text within python code should be of type 'unicode'.


    >>> s = 'foo'
    >>> s
    >>> type(s)
    <type 'str'>


    >>> u = u'foo'
    >>> u
    >>> type(u)
    <type 'unicode'>
  • Transitions between internal unicode and external strings should always be immediately and explicitly encoded or decoded.

  • All external text that is not explicitly encoded (database storage, commandline arguments, etc.) should be presumed to be encoded as utf-8.


    mystring = infile.readline() myreturnstring = do_some_magic_with(mystring) outfile.write(myreturnstring)


    mystring = infile.readline() mytext = s.decode('utf-8') returntext = do_some_magic_with(mytext) returnstring = returntext.encode('utf-8') outfile.write(returnstring)

Running Tests

The testing system is based on a combination of tox and testr. If you just want to run the whole suite, run tox and all will be fine. However, if you'd like to dig in a bit more, you might want to learn some things about testr itself. A basic walkthrough for OpenStack can be found at

Jump to Line
Something went wrong with that request. Please try again.