File tree 1 file changed +19
-1
lines changed 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -622,8 +622,26 @@ def test_redirect_stdout(self):
622
622
623
623
self .assertIn ('foo' , output [0 ])
624
624
625
+ def test_running_multiple_instances (self ):
626
+ spinner = Halo ("foo" , stream = self ._stream )
627
+ _instance = Halo ()
628
+ # Pretend that another spinner is being displayed under spinner
629
+ _instance ._content = "Some lines\n "
630
+ Halo ._instances .extend ([spinner , _instance ])
631
+ spinner .start ()
632
+ time .sleep (1 )
633
+ spinner .stop ()
634
+ spinner .stop_and_persist (text = "Done" )
635
+ output = self ._get_test_output ()["text" ]
636
+ self .assertEqual (output [0 ], "{} foo" .format (frames [0 ]))
637
+ self .assertEqual (output [1 ], "Some lines" )
638
+ self .assertEqual (output [2 ], "{} foo" .format (frames [1 ]))
639
+ self .assertEqual (output [3 ], "Some lines" )
640
+ self .assertEqual (output [- 2 ], " Done" )
641
+ self .assertEqual (output [- 1 ], "Some lines" )
642
+
625
643
def tearDown (self ):
626
- pass
644
+ self . _stream . close ()
627
645
628
646
629
647
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments