manrajgrover / halo

💫 Beautiful spinners for terminal, IPython and Jupyter
MIT License
2.86k stars 148 forks source link

Improve test coverage #88

Closed manrajgrover closed 5 years ago

manrajgrover commented 5 years ago

Description

Currently, the test coverage is around 88% which is okay but we can improve it. This issue focuses on adding tests covering missing branches.

People to notify

@manrajgrover

Lilja commented 5 years ago

I'm interested!

manrajgrover commented 5 years ago

@Lilja Go ahead! Do let me know if you need any assistance.

Lilja commented 5 years ago

Status report: Trying out the bounce animation, but i'm not sure if I discovered a bug or not.

text = "{}abc".format("_" * 80)
spinner = Halo(text, animation="bounce")
print(text.__len__())
spinner.start()
time.sleep(4)
spinner.stop()

Output(frames):

- ______________________________________________________________________________
\ ______________________________________________________________________________
| ______________________________________________________________________________
/ _____________________________________________________________________________a
- ____________________________________________________________________________ab
\ ____________________________________________________________________________ab
| _____________________________________________________________________________a
/ ______________________________________________________________________________

Shouldn't there be a C somewhere? Win10, python 3.6.4 EDIT: terminal width of 78

Lilja commented 5 years ago

Offsetting the range by +1 fixes it. https://github.com/manrajgrover/halo/blob/0767ac1d6e827cbe53347d9141eb3667b7b61019/halo/halo.py#L280

manrajgrover commented 5 years ago

@Lilja Interesting, can you open a separate issue for tracking this?

Lilja commented 5 years ago

@manrajgrover Sure thing