Exemplo n.º 1
0
    def test_examples(self):
        # Simple cases
        self.assertEqual('server', t('Server'))
        self.assertEqual('my_server', t('MyServer'))

        # With numbers
        self.assertEqual('int32_to_string', t('Int32ToString'))
        self.assertEqual('32_to_string', t('32ToString'))
        self.assertEqual('to_int32', t('ToInt32'))

        # With multiple capitals
        self.assertEqual('https', t('HTTPS'))
        self.assertEqual('http_server', t('HTTPServer'))
        self.assertEqual('my_http_server', t('MyHTTPServer'))
        self.assertEqual('http_server_ssl', t('HTTPServerSSL'))

        # With underscores
        self.assertEqual('_http_server', t('_HTTPServer'))
        self.assertEqual('http__server', t('HTTP_Server'))
Exemplo n.º 2
0
    def test_examples(self):
        # Simple cases
        self.assertEqual('server', t('Server'))
        self.assertEqual('my_server', t('MyServer'))

        # With numbers
        self.assertEqual('int32_to_string', t('Int32ToString'))
        self.assertEqual('32_to_string', t('32ToString'))
        self.assertEqual('to_int32', t('ToInt32'))

        # With multiple capitals
        self.assertEqual('https', t('HTTPS'))
        self.assertEqual('http_server', t('HTTPServer'))
        self.assertEqual('my_http_server', t('MyHTTPServer'))
        self.assertEqual('http_server_ssl', t('HTTPServerSSL'))

        # With underscores
        self.assertEqual('_http_server', t('_HTTPServer'))
        self.assertEqual('http__server', t('HTTP_Server'))
Exemplo n.º 3
0
 def test_non_camel_case_examples(self):
     self.assertEqual('foobar', t('foobar'))
     self.assertEqual('foo__bar', t('foo_bar'))
     self.assertEqual('_foobar', t('_foobar'))
Exemplo n.º 4
0
 def test_non_camel_case_examples(self):
     self.assertEqual('foobar', t('foobar'))
     self.assertEqual('foo__bar', t('foo_bar'))
     self.assertEqual('_foobar', t('_foobar'))