d i f f   - - g i t   a / a i o p u l s e / e n t i t i e s . p y   b / a i o p u l s e / e n t i t i e s . p y 
 
 n e w   f i l e   m o d e   1 0 0 6 4 4 
 
 i n d e x   0 0 0 0 0 0 0 . . 2 3 b 6 d 6 b 
 
 - - -   / d e v / n u l l 
 
 + + +   b / a i o p u l s e / e n t i t i e s . p y 
 
 @ @   - 0 , 0   + 1 , 2 6   @ @ 
 
 + " " " B a s e   c l a s s   f o r   h u b   e n t i t i e s . " " " 
 
 + f r o m   _ _ f u t u r e _ _   i m p o r t   a n n o t a t i o n s 
 
 + 
 
 + f r o m   t y p i n g   i m p o r t   T Y P E _ C H E C K I N G 
 
 + 
 
 + f r o m   a i o p u l s e . c a l l b a c k s   i m p o r t   C a l l b a c k M i x i n 
 
 + 
 
 + i f   T Y P E _ C H E C K I N G : 
 
 +         f r o m   a i o p u l s e . h u b   i m p o r t   H u b 
 
 + 
 
 + 
 
 + c l a s s   H u b E n t i t y ( C a l l b a c k M i x i n ) : 
 
 +         " " " B a s e   c l a s s   f o r   e n t i t i e s   m a n a g e d   b y   a   h u b . " " " 
 
 + 
 
 +         d e f   _ _ i n i t _ _ ( s e l f ,   h u b :   H u b ,   e n t i t y _ i d :   b y t e s   |   i n t )   - >   N o n e : 
 
 +                 " " " I n i t i a l i z e   e n t i t y . 
 
 + 
 
 +                 A r g s : 
 
 +                         h u b :   T h e   h u b   i n s t a n c e   t h a t   m a n a g e s   t h i s   e n t i t y . 
 
 +                         e n t i t y _ i d :   T h e   u n i q u e   i d e n t i f i e r   f o r   t h i s   e n t i t y . 
 
 +                 " " " 
 
 +                 s u p e r ( ) . _ _ i n i t _ _ ( ) 
 
 +                 s e l f . h u b   =   h u b 
 
 +                 s e l f . i d   =   e n t i t y _ i d 
 
 +                 s e l f . n a m e :   s t r   |   N o n e   =   N o n e 
 
 +                 s e l f . i c o n :   i n t   |   N o n e   =   N o n e 
 
 d i f f   - - g i t   a / t e s t s / t e s t _ e n t i t i e s . p y   b / t e s t s / t e s t _ e n t i t i e s . p y 
 
 n e w   f i l e   m o d e   1 0 0 6 4 4 
 
 i n d e x   0 0 0 0 0 0 0 . . a c f e d b 8 
 
 - - -   / d e v / n u l l 
 
 + + +   b / t e s t s / t e s t _ e n t i t i e s . p y 
 
 @ @   - 0 , 0   + 1 , 5 5   @ @ 
 
 + i m p o r t   a s y n c i o 
 
 + 
 
 + i m p o r t   p y t e s t 
 
 + f r o m   u n i t t e s t . m o c k   i m p o r t   M a g i c M o c k 
 
 + 
 
 + f r o m   a i o p u l s e . e n t i t i e s   i m p o r t   H u b E n t i t y 
 
 + 
 
 + 
 
 + c l a s s   C o n c r e t e E n t i t y ( H u b E n t i t y ) : 
 
 +         " " " C o n c r e t e   i m p l e m e n t a t i o n   f o r   t e s t i n g . " " " 
 
 + 
 
 +         p a s s 
 
 + 
 
 + 
 
 + c l a s s   T e s t H u b E n t i t y : 
 
 +         @ p y t e s t . f i x t u r e 
 
 +         d e f   h u b _ m o c k ( s e l f ) : 
 
 +                 h u b   =   M a g i c M o c k ( ) 
 
 +                 h u b . h o s t   =   " 1 9 2 . 1 6 8 . 1 . 1 0 0 " 
 
 +                 r e t u r n   h u b 
 
 + 
 
 +         @ p y t e s t . f i x t u r e 
 
 +         d e f   e n t i t y ( s e l f ,   h u b _ m o c k ) : 
 
 +                 r e t u r n   C o n c r e t e E n t i t y ( h u b = h u b _ m o c k ,   e n t i t y _ i d = 1 2 3 ) 
 
 + 
 
 +         d e f   t e s t _ i n i t _ w i t h _ i n t _ i d ( s e l f ,   h u b _ m o c k ) : 
 
 +                 e n t i t y   =   C o n c r e t e E n t i t y ( h u b = h u b _ m o c k ,   e n t i t y _ i d = 1 2 3 ) 
 
 +                 a s s e r t   e n t i t y . h u b   = =   h u b _ m o c k 
 
 +                 a s s e r t   e n t i t y . i d   = =   1 2 3 
 
 +                 a s s e r t   e n t i t y . n a m e   i s   N o n e 
 
 +                 a s s e r t   e n t i t y . i c o n   i s   N o n e 
 
 +                 a s s e r t   e n t i t y . _ u p d a t e _ c a l l b a c k s   = =   [ ] 
 
 + 
 
 +         d e f   t e s t _ i n i t _ w i t h _ b y t e s _ i d ( s e l f ,   h u b _ m o c k ) : 
 
 +                 e n t i t y   =   C o n c r e t e E n t i t y ( h u b = h u b _ m o c k ,   e n t i t y _ i d = b " \ x 0 1 \ x 0 2 \ x 0 3 \ x 0 4 " ) 
 
 +                 a s s e r t   e n t i t y . i d   = =   b " \ x 0 1 \ x 0 2 \ x 0 3 \ x 0 4 " 
 
 + 
 
 +         d e f   t e s t _ c a l l b a c k _ s u b s c r i b e ( s e l f ,   e n t i t y ) : 
 
 +                 c a l l b a c k   =   M a g i c M o c k ( ) 
 
 +                 e n t i t y . c a l l b a c k _ s u b s c r i b e ( c a l l b a c k ) 
 
 +                 a s s e r t   c a l l b a c k   i n   e n t i t y . _ u p d a t e _ c a l l b a c k s 
 
 + 
 
 +         d e f   t e s t _ c a l l b a c k _ u n s u b s c r i b e ( s e l f ,   e n t i t y ) : 
 
 +                 c a l l b a c k   =   M a g i c M o c k ( ) 
 
 +                 e n t i t y . _ u p d a t e _ c a l l b a c k s . a p p e n d ( c a l l b a c k ) 
 
 +                 e n t i t y . c a l l b a c k _ u n s u b s c r i b e ( c a l l b a c k ) 
 
 +                 a s s e r t   c a l l b a c k   n o t   i n   e n t i t y . _ u p d a t e _ c a l l b a c k s 
 
 + 
 
 +         @ p y t e s t . m a r k . a s y n c i o 
 
 +         a s y n c   d e f   t e s t _ n o t i f y _ c a l l b a c k ( s e l f ,   e n t i t y ) : 
 
 +                 c a l l b a c k   =   M a g i c M o c k ( ) 
 
 +                 e n t i t y . _ u p d a t e _ c a l l b a c k s . a p p e n d ( c a l l b a c k ) 
 
 +                 e n t i t y . n o t i f y _ c a l l b a c k ( ) 
 
 +                 a w a i t   a s y n c i o . s l e e p ( 0 . 1 ) 
 
 +                 c a l l b a c k . a s s e r t _ c a l l e d _ o n c e ( ) 
 
 