#NEWLINE# def test_entity_extent_membership_simple( self ) : #NEWLINE# #INDENT# from grease import World , Entity #NEWLINE# class MyEntity ( Entity ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class Another ( Entity ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# world = World ( ) #NEWLINE# self . assertFalse ( world . entities ) #NEWLINE# extent = world [ MyEntity ] #NEWLINE# self . assertFalse ( extent . entities ) #NEWLINE# entity1 = MyEntity ( world ) #NEWLINE# self . assertTrue ( ( entity1 in extent . entities ) ) #NEWLINE# entity2 = MyEntity ( world ) #NEWLINE# self . assertTrue ( ( entity2 in extent . entities ) ) #NEWLINE# world . entities . remove ( entity2 ) #NEWLINE# self . assertTrue ( ( entity1 in extent . entities ) ) #NEWLINE# self . assertFalse ( ( entity2 in extent . entities ) ) #NEWLINE# entity3 = Another ( world ) #NEWLINE# self . assertFalse ( ( entity3 in extent . entities ) ) #NEWLINE# self . assertTrue ( ( entity3 in world [ Another ] . entities ) )