From 2dcefdbc91957e2cce15ca3b8e06d1aa395643a8 Mon Sep 17 00:00:00 2001 From: Henning Jacobs Date: Wed, 24 Jun 2015 20:00:55 +0200 Subject: [PATCH] add some trivial doctest examples --- pg_view.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pg_view.py b/pg_view.py index 49fb87e..d939b6b 100644 --- a/pg_view.py +++ b/pg_view.py @@ -92,6 +92,12 @@ def get_valid_output_methods(): def output_method_is_valid(method): + ''' + >>> output_method_is_valid('foo') + False + >>> output_method_is_valid('curses') + True + ''' return method in get_valid_output_methods() @@ -2894,6 +2900,12 @@ def get_postmasters_directories(): def get_dbname_from_path(db_path): + ''' + >>> get_dbname_from_path('foo') + 'foo' + >>> get_dbname_from_path('/pgsql_bar/9.4/data') + 'bar' + ''' m = re.search(r'/pgsql_(.*?)(/\d+.\d+)?/data/?', db_path) if m: dbname = m.group(1)