File: test_app.py

package info (click to toggle)
python-trame 3.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 101,620 kB
  • sloc: python: 13,515; sh: 183; javascript: 93; makefile: 7
file content (10 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
def test_singleton():
    from trame.app.singleton import Singleton

    @Singleton
    def new_object():
        return object()

    # Normally, a new object would be returned each time
    # However, since this is a singleton, the same object should be returned
    assert new_object() is new_object()