code: def test_scalar_potential():
      assert scalar_potential(0, R) == 0
      assert scalar_potential(R.x, R) == R[0]
      assert scalar_potential(R.y, R) == R[1]
      assert scalar_potential(R.z, R) == R[2]
      assert (
          scalar_potential(
              R[1] * R[2] * R.x + R[0] * R[2] * R.y + R[0] * R[1] * R.z,
              R,
          )
          == R[0] * R[1] * R[2]
      )
      assert scalar_potential(grad_field, R) == scalar_field
      assert scalar_potential(R[2] * P.x + P[0] * R.z, R) == R[0] * R[
          2
      ] * cos(q) + R[1] * R[2] * sin(q)
      assert scalar_potential(R[2] * P.x + P[0] * R.z, P) == P[0] * P[2]
      raises(ValueError, lambda: scalar_potential(R[0] * R.y, R))
  
file_path: sympy/sympy/physics/vector/tests/test_fieldfunctions.py
imports: from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.physics.vector import ReferenceFrame, Vector, Point, dynamicsymbols
  from sympy.physics.vector.fieldfunctions import divergence, gradient, curl, is_conservative, is_solenoidal, scalar_potential, scalar_potential_difference
  from sympy.testing.pytest import raises
label_desc: Use image node_id 6 for calling a global function with example usage: test_scalar_potential() without return types