code: def test_category():
      A = Object("A")
      B = Object("B")
      C = Object("C")
  
      f = NamedMorphism(A, B, "f")
      g = NamedMorphism(B, C, "g")
  
      d1 = Diagram([f, g])
      d2 = Diagram([f])
  
      objects = d1.objects | d2.objects
  
      K = Category("K", objects, commutative_diagrams=[d1, d2])
  
      assert K.name == "K"
      assert K.objects == Class(objects)
      assert K.commutative_diagrams == FiniteSet(d1, d2)
  
      raises(ValueError, lambda: Category(""))
  
file_path: sympy/sympy/categories/tests/test_baseclasses.py
imports: from sympy.categories import Object, Morphism, IdentityMorphism, NamedMorphism, CompositeMorphism, Diagram, Category
  from sympy.categories.baseclasses import Class
  from sympy.testing.pytest import raises
  from sympy.core.containers import Dict, Tuple
  from sympy.sets import EmptySet
  from sympy.sets.sets import FiniteSet
label_desc: Use image node_id 3 for calling a global function with example usage: test_category() without return types