Test of the factory module - Parents and Elements

Skip to content
Back to top
View this page
Edit this page

# Test of the `factory` module

class sage.structure.test_factory.A

  Bases: `object`

class sage.structure.test_factory.UniqueFactoryTester

  Bases: `UniqueFactory`

  create_key(*args, **kwds)

    EXAMPLES:

    Sage

        sage: from sage.structure.test_factory import UniqueFactoryTester
        sage: test_factory = UniqueFactoryTester('foo')
        sage: test_factory.create_key(1, 2, 3)
        (1, 2, 3)

    Python

        >>> from sage.all import *
        >>> from sage.structure.test_factory import UniqueFactoryTester
        >>> test_factory = UniqueFactoryTester('foo')
        >>> test_factory.create_key(Integer(1), Integer(2), Integer(3))
        (1, 2, 3)

  create_object(version, key, **extra_args)

    EXAMPLES:

    Sage

        sage: from sage.structure.test_factory import UniqueFactoryTester
        sage: test_factory = UniqueFactoryTester('foo')
        sage: test_factory.create_object('version', key=(1, 2, 4))
        Making object (1, 2, 4)
        <sage.structure.test_factory.A object at ...>

    Python

        >>> from sage.all import *
        >>> from sage.structure.test_factory import UniqueFactoryTester
        >>> test_factory = UniqueFactoryTester('foo')
        >>> test_factory.create_object('version', key=(Integer(1), Integer(2), Integer(4)))
        Making object (1, 2, 4)
        <sage.structure.test_factory.A object at ...>