docstr: Test storage of various data types
docstr_tok: ["Test","storage","of","various","data","types"]
code: def test_variables_set_different_types(self):
      """Test storage of various data types"""
      # Set a dict
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "dict", '{"foo": "oops"}']
          )
      )
      # Set a list
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "list", '["oops"]']
          )
      )
      # Set str
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "str", "hello string"]
          )
      )
      # Set int
      variable_command.variables_set(
          self.parser.parse_args(["variables", "set", "int", "42"])
      )
      # Set float
      variable_command.variables_set(
          self.parser.parse_args(["variables", "set", "float", "42.0"])
      )
      # Set true
      variable_command.variables_set(
          self.parser.parse_args(["variables", "set", "true", "true"])
      )
      # Set false
      variable_command.variables_set(
          self.parser.parse_args(["variables", "set", "false", "false"])
      )
      # Set none
      variable_command.variables_set(
          self.parser.parse_args(["variables", "set", "null", "null"])
      )
  
      # Export and then import
      variable_command.variables_export(
          self.parser.parse_args(
              ["variables", "export", "variables_types.json"]
          )
      )
      variable_command.variables_import(
          self.parser.parse_args(
              ["variables", "import", "variables_types.json"]
          )
      )
  
      # Assert value
      assert {"foo": "oops"} == Variable.get(
          "dict", deserialize_json=True
      )
      assert ["oops"] == Variable.get("list", deserialize_json=True)
      assert "hello string" == Variable.get(
          "str"
      )  # cannot json.loads(str)
      assert 42 == Variable.get("int", deserialize_json=True)
      assert 42.0 == Variable.get("float", deserialize_json=True)
      assert Variable.get("true", deserialize_json=True) is True
      assert Variable.get("false", deserialize_json=True) is False
      assert Variable.get("null", deserialize_json=True) is None
  
      # test variable import skip existing
      # set varliable list to ["airflow"] and have it skip during import
      variable_command.variables_set(
          self.parser.parse_args(
              ["variables", "set", "list", '["airflow"]']
          )
      )
      variable_command.variables_import(
          self.parser.parse_args(
              [
                  "variables",
                  "import",
                  "variables_types.json",
                  "--action-on-existing-key",
                  "skip",
              ]
          )
      )
      assert ["airflow"] == Variable.get(
          "list", deserialize_json=True
      )  # should not be overwritten
  
      # test variable import fails on existing when action is set to fail
      with pytest.raises(SystemExit):
          variable_command.variables_import(
              self.parser.parse_args(
                  [
                      "variables",
                      "import",
                      "variables_types.json",
                      "--action-on-existing-key",
                      "fail",
                  ]
              )
          )
  
      os.remove("variables_types.json")
  
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 9 for calling the TestCliVariables obj's underlying member method code with example usage: obj.test_variables_set_different_types() without return types