class_docstr: Test coherence of read-only database and its wrapped database.
docstr: Test that attributes for writing are not accessible.
code: def test_invalid_attributes(self, storage):
      """Test that attributes for writing are not accessible."""
      database = storage._db
      readonly_database = ReadOnlyDB(database)
  
      # Test that database.ensure_index indeed exists
      database.ensure_index
      with pytest.raises(AttributeError):
          readonly_database.ensure_index
  
      # Test that database.write indeed exists
      database.write
      with pytest.raises(AttributeError):
          readonly_database.write
  
      # Test that database.read_and_write indeed exists
      database.read_and_write
      with pytest.raises(AttributeError):
          readonly_database.read_and_write
  
      # Test that database.remove indeed exists
      database.remove
      with pytest.raises(AttributeError):
          readonly_database.remove
  
file_path: orion/tests/unittests/core/io/database_test.py
imports: import pytest
  from orion.core.io.database import ReadOnlyDB, database_factory
  from orion.storage.base import setup_storage
label_desc: Use image node_id 3 for calling the TestReadOnlyDatabase obj's underlying member method code with example usage: obj.test_invalid_attributes(storage) without return types