test_progress_bar.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. __author__ = "Christian Heider Nielsen"
  4. __doc__ = r"""
  5. Created on 30-12-2020
  6. """
  7. from draugr.tqdm_utilities import progress_bar
  8. def test_progress_bar():
  9. for a in progress_bar(range(100), notifications=False):
  10. pass
  11. def test_asudhweasijdq():
  12. sas = [f"a{a}" for a in range(5)]
  13. for a in progress_bar(sas, notifications=False):
  14. pass
  15. def test_asudhwea213si23jdq():
  16. def sas(l):
  17. """ """
  18. yield from range(l)
  19. for a in progress_bar(sas(129), notifications=False):
  20. pass
  21. def test_asudhweasi23jdq():
  22. def sas():
  23. """ """
  24. yield from range(100)
  25. for a in progress_bar(sas(), notifications=False):
  26. pass
  27. def test_dsad3123():
  28. for a in progress_bar([2.13, 8921.9123, 923], notifications=False):
  29. pass
  30. def test_dsad311231223():
  31. for a in progress_bar(
  32. (
  33. 2.13,
  34. 8921.9123,
  35. 923,
  36. 821738,
  37. 782173,
  38. 8912738124,
  39. 8471827,
  40. 661262,
  41. 1111,
  42. 2222,
  43. 3333,
  44. 4444,
  45. 5555,
  46. ),
  47. notifications=False,
  48. ):
  49. pass
  50. def test_ds12sadad311231223():
  51. for a in progress_bar(
  52. {
  53. 2.13j,
  54. 8921.9123j,
  55. 923j,
  56. 821738j,
  57. 782173j,
  58. 8912738124j,
  59. 8471827j,
  60. 661262j,
  61. 1111j,
  62. 2222j,
  63. 3333j,
  64. 4444j,
  65. 5555j,
  66. },
  67. notifications=False,
  68. ):
  69. pass
  70. def test_ds12s23():
  71. for a in progress_bar(
  72. [[2.13j], [8921.9123j], [923j], [821738j], [782173j]], notifications=False
  73. ):
  74. pass
  75. def test_ds1saijd2s23():
  76. a1 = range(6)
  77. b2 = range(6)
  78. for _ in progress_bar(a1, notifications=False):
  79. pass
  80. for _ in progress_bar(b2, notifications=False):
  81. pass
  82. def test_dict_items():
  83. from time import sleep
  84. class exp_v:
  85. Test_Sets = {v: v for v in range(9)}
  86. for a in progress_bar(exp_v.Test_Sets.items()):
  87. sleep(1)
  88. if __name__ == "__main__":
  89. test_progress_bar()
  90. test_asudhweasijdq()
  91. test_asudhweasi23jdq()
  92. test_dsad3123()
  93. test_dsad311231223()
  94. test_ds12sadad311231223()
  95. test_ds12s23()
  96. test_asudhwea213si23jdq()
  97. test_ds1saijd2s23()
  98. test_dict_items()