Exemple #1
0
  def test_camelcase(self):

    self.assertEqual('Foo', camelcase('foo'))
    self.assertEqual('Foo', camelcase('_foo'))
    self.assertEqual('Foo', camelcase('foo_'))
    self.assertEqual('FooBar', camelcase('foo_bar'))
    self.assertEqual('FooBar', camelcase('foo_bar_'))
    self.assertEqual('FooBar', camelcase('_foo_bar'))
    self.assertEqual('FooBar', camelcase('foo__bar'))
    self.assertEqual('Foo', camelcase('-foo'))
    self.assertEqual('Foo', camelcase('foo-'))
    self.assertEqual('FooBar', camelcase('foo-bar'))
    self.assertEqual('FooBar', camelcase('foo-bar-'))
    self.assertEqual('FooBar', camelcase('-foo-bar'))
    self.assertEqual('FooBar', camelcase('foo--bar'))
    self.assertEqual('FooBar', camelcase('foo-_bar'))
Exemple #2
0
    def test_camelcase(self) -> None:

        self.assertEqual("Foo", camelcase("foo"))
        self.assertEqual("Foo", camelcase("_foo"))
        self.assertEqual("Foo", camelcase("foo_"))
        self.assertEqual("FooBar", camelcase("foo_bar"))
        self.assertEqual("FooBar", camelcase("foo_bar_"))
        self.assertEqual("FooBar", camelcase("_foo_bar"))
        self.assertEqual("FooBar", camelcase("foo__bar"))
        self.assertEqual("Foo", camelcase("-foo"))
        self.assertEqual("Foo", camelcase("foo-"))
        self.assertEqual("FooBar", camelcase("foo-bar"))
        self.assertEqual("FooBar", camelcase("foo-bar-"))
        self.assertEqual("FooBar", camelcase("-foo-bar"))
        self.assertEqual("FooBar", camelcase("foo--bar"))
        self.assertEqual("FooBar", camelcase("foo-_bar"))
Exemple #3
0
  def test_camelcase(self) -> None:

    self.assertEqual('Foo', camelcase('foo'))
    self.assertEqual('Foo', camelcase('_foo'))
    self.assertEqual('Foo', camelcase('foo_'))
    self.assertEqual('FooBar', camelcase('foo_bar'))
    self.assertEqual('FooBar', camelcase('foo_bar_'))
    self.assertEqual('FooBar', camelcase('_foo_bar'))
    self.assertEqual('FooBar', camelcase('foo__bar'))
    self.assertEqual('Foo', camelcase('-foo'))
    self.assertEqual('Foo', camelcase('foo-'))
    self.assertEqual('FooBar', camelcase('foo-bar'))
    self.assertEqual('FooBar', camelcase('foo-bar-'))
    self.assertEqual('FooBar', camelcase('-foo-bar'))
    self.assertEqual('FooBar', camelcase('foo--bar'))
    self.assertEqual('FooBar', camelcase('foo-_bar'))
def get_outer_class_name(source):
  filename = re.sub(r'\.proto$', '', os.path.basename(source))
  return camelcase(filename)
Exemple #5
0
def get_outer_class_name(source):
    filename = re.sub(r'\.proto$', '', os.path.basename(source))
    return camelcase(filename)
Exemple #6
0
    def test_camelcase(self):

        self.assertEquals("Foo", camelcase("foo"))
        self.assertEquals("Foo", camelcase("_foo"))
        self.assertEquals("Foo", camelcase("foo_"))
        self.assertEquals("FooBar", camelcase("foo_bar"))
        self.assertEquals("FooBar", camelcase("foo_bar_"))
        self.assertEquals("FooBar", camelcase("_foo_bar"))
        self.assertEquals("FooBar", camelcase("foo__bar"))
        self.assertEquals("Foo", camelcase("-foo"))
        self.assertEquals("Foo", camelcase("foo-"))
        self.assertEquals("FooBar", camelcase("foo-bar"))
        self.assertEquals("FooBar", camelcase("foo-bar-"))
        self.assertEquals("FooBar", camelcase("-foo-bar"))
        self.assertEquals("FooBar", camelcase("foo--bar"))
        self.assertEquals("FooBar", camelcase("foo-_bar"))