~radix/storm/database-trace-hook

« back to all changes in this revision

Viewing changes to tests/databases/base.py

Merge no-underscore-parse-methods [r=niemeyer,jkakar] [f=128060]

Now it's easy to tell what you can touch in Storm: If it begins with
an underscore, you definitely can't touch it in any way. If it doesn't
begin with an underscore, read the documentation to see how it's meant
to be used. If it doesn't have a docstring, file a bug. :-)

This branch renames _parse_get, _parse_set, _from_database, _to_database,
_build_raw_cursor, _raw_execute, _result_factory, _param_mark, _compile,
and _connection_factory so that they no longer have preceding underscores,
because they were all meant to be overridden in subclasses. Documentation
was added on their intended usage.

It also adds a LOT of documentation to store.py, variables.py, and
database.py, and fixes a few existing docstrings to be valid epytext.

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
 
328
328
    def test_wb_result_get_one_goes_through_from_database(self):
329
329
        result = self.connection.execute("SELECT one, two FROM number")
330
 
        result._from_database = self.from_database
 
330
        result.from_database = self.from_database
331
331
        self.assertEquals(result.get_one(), (2, 3))
332
332
 
333
333
    def test_wb_result_get_all_goes_through_from_database(self):
334
334
        result = self.connection.execute("SELECT one, two FROM number")
335
 
        result._from_database = self.from_database
 
335
        result.from_database = self.from_database
336
336
        self.assertEquals(result.get_all(), [(2, 3)])
337
337
 
338
338
    def test_wb_result_iter_goes_through_from_database(self):
339
339
        result = self.connection.execute("SELECT one, two FROM number")
340
 
        result._from_database = self.from_database
 
340
        result.from_database = self.from_database
341
341
        self.assertEquals(iter(result).next(), (2, 3))
342
342
 
343
343