def testNameToLabel(self):
     """
     Test the various kinds of inputs L{nameToLabel} supports.
     """
     nameData = [("f", "F"), ("fo", "Fo"), ("foo", "Foo"), ("fooBar", "Foo Bar"), ("fooBarBaz", "Foo Bar Baz")]
     for inp, out in nameData:
         got = util.nameToLabel(inp)
         self.assertEquals(got, out, "nameToLabel(%r) == %r != %r" % (inp, got, out))
Exemplo n.º 2
0
 def test_nameToLabel(self):
     """
     Test the various kinds of inputs L{nameToLabel} supports.
     """
     nameData = [
         ("f", "F"),
         ("fo", "Fo"),
         ("foo", "Foo"),
         ("fooBar", "Foo Bar"),
         ("fooBarBaz", "Foo Bar Baz"),
     ]
     for inp, out in nameData:
         got = util.nameToLabel(inp)
         self.assertEqual(got, out, f"nameToLabel({inp!r}) == {got!r} != {out!r}")
 def testNameToLabel(self):
     """
     Test the various kinds of inputs L{nameToLabel} supports.
     """
     nameData = [
         ('f', 'F'),
         ('fo', 'Fo'),
         ('foo', 'Foo'),
         ('fooBar', 'Foo Bar'),
         ('fooBarBaz', 'Foo Bar Baz'),
     ]
     for inp, out in nameData:
         got = util.nameToLabel(inp)
         self.assertEqual(got, out,
                          "nameToLabel(%r) == %r != %r" % (inp, got, out))
Exemplo n.º 4
0
 def test_nameToLabel(self):
     """
     Test the various kinds of inputs L{nameToLabel} supports.
     """
     nameData = [
         ("f", "F"),
         ("fo", "Fo"),
         ("foo", "Foo"),
         ("fooBar", "Foo Bar"),
         ("fooBarBaz", "Foo Bar Baz"),
     ]
     for inp, out in nameData:
         got = util.nameToLabel(inp)
         self.assertEqual(got, out,
                          "nameToLabel(%r) == %r != %r" % (inp, got, out))
Exemplo n.º 5
0
 def testNameToLabel(self):
     """
     Test the various kinds of inputs L{nameToLabel} supports.
     """
     nameData = [
         ('f', 'F'),
         ('fo', 'Fo'),
         ('foo', 'Foo'),
         ('fooBar', 'Foo Bar'),
         ('fooBarBaz', 'Foo Bar Baz'),
         ]
     for inp, out in nameData:
         got = util.nameToLabel(inp)
         self.assertEquals(
             got, out,
             "nameToLabel(%r) == %r != %r" % (inp, got, out))
Exemplo n.º 6
0
 def inspect(self):
     """
     Return a multi-line, human-readable representation of this DN.
     """
     l = []
     lablen = 0
     def uniqueValues(mapping):
         return dict.fromkeys(mapping.itervalues()).keys()
     for k in uniqueValues(_x509names):
         label = util.nameToLabel(k)
         lablen = max(len(label), lablen)
         v = getattr(self, k, None)
         if v is not None:
             l.append((label, v))
     lablen += 2
     for n, (label, attr) in enumerate(l):
         l[n] = (label.rjust(lablen)+': '+ attr)
     return '\n'.join(l)
Exemplo n.º 7
0
 def inspect(self):
     """
     Return a multi-line, human-readable representation of this DN.
     """
     l = []
     lablen = 0
     def uniqueValues(mapping):
         return dict.fromkeys(mapping.itervalues()).keys()
     for k in uniqueValues(_x509names):
         label = util.nameToLabel(k)
         lablen = max(len(label), lablen)
         v = getattr(self, k, None)
         if v is not None:
             l.append((label, v))
     lablen += 2
     for n, (label, attr) in enumerate(l):
         l[n] = (label.rjust(lablen)+': '+ attr)
     return '\n'.join(l)
Exemplo n.º 8
0
    def inspect(self):
        """
        Return a multi-line, human-readable representation of this DN.

        @rtype: C{str}
        """
        l = []
        lablen = 0
        def uniqueValues(mapping):
            return set(mapping.values())
        for k in sorted(uniqueValues(_x509names)):
            label = util.nameToLabel(k)
            lablen = max(len(label), lablen)
            v = getattr(self, k, None)
            if v is not None:
                l.append((label, nativeString(v)))
        lablen += 2
        for n, (label, attr) in enumerate(l):
            l[n] = (label.rjust(lablen)+': '+ attr)
        return '\n'.join(l)
Exemplo n.º 9
0
    def inspect(self):
        """
        Return a multi-line, human-readable representation of this DN.

        @rtype: C{str}
        """
        l = []
        lablen = 0
        def uniqueValues(mapping):
            return set(mapping.values())
        for k in sorted(uniqueValues(_x509names)):
            label = util.nameToLabel(k)
            lablen = max(len(label), lablen)
            v = getattr(self, k, None)
            if v is not None:
                l.append((label, nativeString(v)))
        lablen += 2
        for n, (label, attr) in enumerate(l):
            l[n] = (label.rjust(lablen)+': '+ attr)
        return '\n'.join(l)