code: def test_invalid_call(origin=None, tdir=None):
      ds = Dataset(origin).create()
      # no target
      assert_status("impossible", ds.push(on_failure="ignore"))
      # no dataset
      with chpwd(tdir):
          assert_raises(InsufficientArgumentsError, Push.__call__)
      # dataset, but outside path
      assert_raises(IncompleteResultsError, ds.push, path=tdir)
      # given a path constraint that doesn't match anything, will cause
      # nothing to be done
      assert_status("notneeded", ds.push(path=ds.pathobj / "nothere"))
  
      # unavailable subdataset
      dummy_sub = ds.create("sub")
      dummy_sub.drop(what="all", reckless="kill", recursive=True)
      assert_in(
          "sub", ds.subdatasets(state="absent", result_xfm="relpaths")
      )
      # now an explicit call to publish the unavailable subdataset
      assert_raises(ValueError, ds.push, "sub")
  
      target = mk_push_target(ds, "target", tdir, annex=True)
      # revision that doesn't exist
      assert_raises(
          ValueError, ds.push, to="target", since="09320957509720437523"
      )
  
      # If a publish() user accidentally passes since='', which push() spells as
      # since='^', the call is aborted.
      assert_raises(ValueError, ds.push, to="target", since="")
  
imports: import logging
  import os
  import pytest
  from datalad.core.distributed.clone import Clone
  from datalad.core.distributed.push import Push
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import IncompleteResultsError, InsufficientArgumentsError
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.support.network import get_local_file_url
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, eq_, known_failure_githubci_osx, known_failure_githubci_win, neq_, ok_, ok_file_has_content, serve_path_via_http, skip_if_adjusted_branch, skip_if_on_windows, skip_ssh, slow, swallow_logs, with_tempfile, with_tree
  from datalad.utils import Path, chpwd, path_startswith, swallow_outputs
label_desc: Use image node_id 1 for calling a global function with example usage: test_invalid_call(origin, tdir) without return types