# Path: openid/kvform.py
# _LOGGER = logging.getLogger(__name__)
# class KVFormError(ValueError):
# def seqToKV(seq, strict=False):
#     def err(msg):
# def kvToSeq(data, strict=False):
#     def err(msg):
# def dictToKV(d):
# def kvToDict(s):


import unittest
import six
from testfixtures import LogCapture
from openid import kvform
            with LogCapture() as logbook:
                d = kvform.kvToDict(kv_data)

            # make sure it parses to expected dict
            self.assertEqual(d, result)

            # Check to make sure we got the expected number of warnings
            self.assertEqual(len(logbook.records), expected_warnings)

            # Convert back to KVForm and round-trip back to dict to make
            # sure that *** dict -> kv -> dict is identity. ***
            kv = kvform.dictToKV(d)
            d2 = kvform.kvToDict(kv)
            self.assertEqual(d, d2)


class KVSeqTest(unittest.TestCase):

    def cleanSeq(self, seq):
        """Create a new sequence by stripping whitespace from start
        and end of each value of each pair"""
        clean = []
        for k, v in seq:
            clean.append((k.strip(), v.strip()))
        return clean

    def runTest(self):
        for kv_data, result, expected_warnings in kvseq_cases:
            # seq serializes to expected kvform
            with LogCapture() as logbook:

# Path: openid/kvform.py
# _LOGGER = logging.getLogger(__name__)
# class KVFormError(ValueError):
# def seqToKV(seq, strict=False):
#     def err(msg):
# def kvToSeq(data, strict=False):
#     def err(msg):
# def dictToKV(d):
# def kvToDict(s):


# Path: openid/test/test_kvform.py
import unittest
import six
from testfixtures import LogCapture
from openid import kvform

            with LogCapture() as logbook:
                d = kvform.kvToDict(kv_data)

            # make sure it parses to expected dict
            self.assertEqual(d, result)

            # Check to make sure we got the expected number of warnings
            self.assertEqual(len(logbook.records), expected_warnings)

            # Convert back to KVForm and round-trip back to dict to make
            # sure that *** dict -> kv -> dict is identity. ***
            kv = kvform.dictToKV(d)
            d2 = kvform.kvToDict(kv)
            self.assertEqual(d, d2)


class KVSeqTest(unittest.TestCase):

    def cleanSeq(self, seq):
        """Create a new sequence by stripping whitespace from start
        and end of each value of each pair"""
        clean = []
        for k, v in seq:
            clean.append((k.strip(), v.strip()))
        return clean

    def runTest(self):
        for kv_data, result, expected_warnings in kvseq_cases:
            # seq serializes to expected kvform
            with LogCapture() as logbook:

                actual = kvform.seqToKV(kv_data)