code: def test_main(ex):
      @ex.main
      def foo():
          pass
  
      assert "foo" in ex.commands
      assert ex.commands["foo"] == foo
      assert ex.default_command == "foo"
  
imports: from sacred import Ingredient
  from mock import patch
  import pytest
  import sys
  from sacred import cli_option
  from sacred import host_info_gatherer
  from sacred.experiment import Experiment
  from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedError, SacredError
label_desc: Use image node_id 2 for calling a global function with example usage: test_main(ex) without return types