class_docstr: Test case for CF writer.
docstr: Test saving global attributes history and Conventions.
docstr_tok: ["Test","saving","global","attributes","history","and","Conventions","."]
code: def test_global_attr_history_and_Conventions(self):
      """Test saving global attributes history and Conventions."""
      scn = Scene()
      start_time = datetime(2018, 5, 30, 10, 0)
      end_time = datetime(2018, 5, 30, 10, 15)
      scn["test-array"] = xr.DataArray(
          [[1, 2, 3]],
          dims=("y", "x"),
          attrs=dict(
              start_time=start_time,
              end_time=end_time,
              prerequisites=[make_dsq(name="hej")],
          ),
      )
      header_attrs = {}
      header_attrs["history"] = ("TEST add history",)
      header_attrs["Conventions"] = "CF-1.7, ACDD-1.3"
      with TempFile() as filename:
          scn.save_datasets(
              filename=filename, writer="cf", header_attrs=header_attrs
          )
          with xr.open_dataset(filename) as f:
              assert f.attrs["Conventions"] == "CF-1.7, ACDD-1.3"
              assert "TEST add history\n" in f.attrs["history"]
              assert "Created by pytroll/satpy on" in f.attrs["history"]
  
imports: import os
  import tempfile
  import warnings
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from packaging.version import Version
  from satpy import Scene
  from satpy.tests.utils import make_dsq
  from satpy.writers.cf_writer import _get_backend_versions
label_desc: Use image node_id 19 for calling the TestCFWriter obj's underlying member method code with example usage: obj.test_global_attr_history_and_Conventions() without return types