Example #1
0
    def test_protect_name(self):
        """
        Test TableMetadata.protect_name output
        """

        table_metadata = TableMetadata('ks_name', 'table_name')

        self.assertEqual(table_metadata.protect_name('tests'), 'tests')
        self.assertEqual(table_metadata.protect_name('test\'s'), '"test\'s"')
        self.assertEqual(table_metadata.protect_name('test\'s'), "\"test's\"")
        self.assertEqual(table_metadata.protect_name('tests ?!@#$%^&*()'), '"tests ?!@#$%^&*()"')
        self.assertEqual(table_metadata.protect_name('1'), '"1"')
        self.assertEqual(table_metadata.protect_name('1test'), '"1test"')