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'))
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 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)
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"))