docstr: Test isolation of variables
docstr_tok: ["Test","isolation","of","variables"]
code: def test_variables_isolation(self, tmp_path):
      """Test isolation of variables"""
      path1 = tmp_path / "testfile1"
      path2 = tmp_path / "testfile2"
  
      # First export
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "foo", '{"foo":"bar"}']
          )
      )
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "bar", "original"]
          )
      )
      variable_command.variables_export(
          self.parser.parse_args(
              ["variables", "export", os.fspath(path1)]
          )
      )
  
      variable_command.variables_set(
          self.parser.parse_args(["variables", "set", "bar", "updated"])
      )
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "foo", '{"foo":"oops"}']
          )
      )
      variable_command.variables_delete(
          self.parser.parse_args(["variables", "delete", "foo"])
      )
      variable_command.variables_import(
          self.parser.parse_args(
              ["variables", "import", os.fspath(path1)]
          )
      )
  
      assert "original" == Variable.get("bar")
      assert '{\n  "foo": "bar"\n}' == Variable.get("foo")
  
      # Second export
      variable_command.variables_export(
          self.parser.parse_args(
              ["variables", "export", os.fspath(path2)]
          )
      )
  
      assert path1.read_text() == path2.read_text()
  
imports: from __future__ import annotations
  import os
  from contextlib import redirect_stdout
  from io import StringIO
  import pytest
  from sqlalchemy import select
  from airflow import models
  from airflow.cli import cli_parser
  from airflow.cli.commands import variable_command
  from airflow.models import Variable
  from airflow.utils.session import create_session
  from tests.test_utils.db import clear_db_variables
label_desc: Use image node_id 14 for calling the TestCliVariables obj's underlying member method code with example usage: obj.test_variables_isolation(tmp_path) without return types