'Test namespace renaming validation.'

def test_rename_validation(self):

    with self.assertRaises(errors.InvalidConfiguration):
        NamespaceConfig(namespace_options={'db1.col1': 'newdb.newcol', 'db2.col1': 'newdb.newcol'})
    with self.assertRaises(errors.InvalidConfiguration):
        NamespaceConfig(namespace_options={'db*.col1': 'newdb.newcol*', 'db*.col2': 'newdb.newcol*'})
    namespace_config = NamespaceConfig(namespace_options={'*.coll': '*.new_coll', 'db.*': 'new_db.*'})
    namespace_config.map_namespace('new_db.coll')
    with self.assertRaises(errors.InvalidConfiguration):
        namespace_config.map_namespace('db.new_coll')
    with self.assertRaises(errors.InvalidConfiguration):
        NamespaceConfig(namespace_options={'db*.col': 'new_db.col_*'})
    with self.assertRaises(errors.InvalidConfiguration):
        NamespaceConfig(namespace_options={'db.*': 'new_db_*.col'})
