# Path: libcloud_rest/api/parser.py
# XHEADERS_TO_ARGS_DICT = {
#     'x-auth-user': 'key',
#     'x-api-key': 'secret',
#     'x-provider-path': 'path',
#     'x-provider-port': 'port',
#     'x-provider-host': 'host',
#     'x-dummy-creds': 'creds',  # FIXME: for tests only
#     'x-provider-key': 'key',
#     'x-provider-uri': 'uri',
#     'x-provider-api-version': 'api_version',
#     'x-provider-secure': 'secure',
#     'x-provider-datacenter': 'datacenter',
# }
# ARGS_TO_XHEADERS_DICT = dict(
#     ([k, v] for v, k in XHEADERS_TO_ARGS_DICT.items()))
# _SUPPORTED_FIELDS = set([
#     '@param',
#     '@type',
#     '@keyword',
#     '@rtype:',
#     '@inherits:',
#     '@return:',
# ])
# def parse_request_headers(headers):
# def get_method_docstring(cls, method_name):
# def _parse_docstring_field(field_lines):
# def _find_parent_cls(cls, cls_name):
# def _parse_inherit(cls, inherits):
# def _ignored_field(field_str):
# def split_docstring(docstring):
# def _check_arguments_dict(arguments):
# def parse_docstring(docstring, cls=None):
# def parse_args(method):


import unittest2
from libcloud_rest.api import parser
from libcloud_rest.errors import MethodParsingException
# -*- coding:utf-8 -*-



class TestParser(unittest2.TestCase):

    def test_get_docsring(self):
        class A(object):
            def foo(self):
                """docstring"""

            def bar(self):
                pass

        class B(A):
            def foo(self):
                pass

            def bar(self):
                pass

        self.assertEqual(parser.get_method_docstring(B, 'foo'), 'docstring')

# Path: libcloud_rest/api/parser.py
# XHEADERS_TO_ARGS_DICT = {
#     'x-auth-user': 'key',
#     'x-api-key': 'secret',
#     'x-provider-path': 'path',
#     'x-provider-port': 'port',
#     'x-provider-host': 'host',
#     'x-dummy-creds': 'creds',  # FIXME: for tests only
#     'x-provider-key': 'key',
#     'x-provider-uri': 'uri',
#     'x-provider-api-version': 'api_version',
#     'x-provider-secure': 'secure',
#     'x-provider-datacenter': 'datacenter',
# }
# ARGS_TO_XHEADERS_DICT = dict(
#     ([k, v] for v, k in XHEADERS_TO_ARGS_DICT.items()))
# _SUPPORTED_FIELDS = set([
#     '@param',
#     '@type',
#     '@keyword',
#     '@rtype:',
#     '@inherits:',
#     '@return:',
# ])
# def parse_request_headers(headers):
# def get_method_docstring(cls, method_name):
# def _parse_docstring_field(field_lines):
# def _find_parent_cls(cls, cls_name):
# def _parse_inherit(cls, inherits):
# def _ignored_field(field_str):
# def split_docstring(docstring):
# def _check_arguments_dict(arguments):
# def parse_docstring(docstring, cls=None):
# def parse_args(method):


# Path: tests/test_parser.py
import unittest2
from libcloud_rest.api import parser
from libcloud_rest.errors import MethodParsingException

# -*- coding:utf-8 -*-



class TestParser(unittest2.TestCase):

    def test_get_docsring(self):
        class A(object):
            def foo(self):
                """docstring"""

            def bar(self):
                pass

        class B(A):
            def foo(self):
                pass

            def bar(self):
                pass

        self.assertEqual(parser.get_method_docstring(B, 'foo'), 'docstring')

        self.assertEqual(parser.get_method_docstring(B, 'bar'), None)