Advertisement
Guest User

Untitled

a guest
Oct 14th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. from server import app, login_manager, system
  2. from system import *
  3.  
  4. #adds history entries for patients Isaac, Hao, Tom, Jack
  5. def test_add_history():
  6. date = "2018-11-02"
  7. patient = "Isaac"
  8. patient_email = "isaac@gmail.com"
  9. provider = "Toby"
  10. healthCentre = "Sydney Hospital"
  11. notes = "sick"
  12. prescription = "Panadol"
  13. history = system.get_history(patient_email)
  14. check = len(history)
  15. system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
  16. history = system.get_history(patient_email)
  17. assert(len(history) == check + 1)
  18.  
  19. def test_add_history_1():
  20. date = "2018-12-02"
  21. patient = "Hao"
  22. patient_email = "hao@gmail.com"
  23. provider = "Toby"
  24. healthCentre = "Sydney Hospital"
  25. notes = "sick"
  26. prescription = "Panadol"
  27. history = system.get_history(patient_email)
  28. check = len(history)
  29. system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
  30. history = system.get_history(patient_email)
  31. assert(len(history) == check + 1)
  32.  
  33. def test_add_history_2():
  34. date = "2018-12-03"
  35. patient = "Tom"
  36. patient_email = "tom@gmail.com"
  37. provider = "Toby"
  38. healthCentre = "Sydney Hospital"
  39. notes = "sick"
  40. prescription = "Panadol"
  41. history = system.get_history(patient_email)
  42. check = len(history)
  43. system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
  44. history = system.get_history(patient_email)
  45. assert(len(history) == check + 1)
  46.  
  47. def test_add_history_3():
  48. date = "2018-12-05"
  49. patient = "Jack"
  50. patient_email = "jack@gmail.com"
  51. provider = "Toby"
  52. healthCentre = "Sydney Hospital"
  53. notes = "sick"
  54. prescription = "Panadol"
  55. history = system.get_history(patient_email)
  56. check = len(history)
  57. system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
  58. history = system.get_history(patient_email)
  59. assert(len(history) == check + 1)
  60.  
  61. def test_add_history_4():
  62. date = "2018-12-10"
  63. patient = "Tom"
  64. patient_email = "tom@gmail.com"
  65. provider = "Toby"
  66. healthCentre = "Sydney Hospital"
  67. notes = "sick"
  68. prescription = "Panadol"
  69. history = system.get_history(patient_email)
  70. check = len(history)
  71. system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
  72. history = system.get_history(patient_email)
  73. assert(len(history) == check + 1)
  74.  
  75. #after adding Tom, Hao, Jack, Isaac making sure that there is greater than 0 entries also asserting that providers have no entries
  76. def test_history():
  77. patient_email = "isaac@gmail.com"
  78. history = system.get_history(patient_email)
  79. assert(len(history) > 0)
  80.  
  81. def test_history_1():
  82. patient_email = "tom@gmail.com"
  83. history = system.get_history(patient_email)
  84. assert(len(history) > 0)
  85.  
  86. def test_history_2():
  87. patient_email = "jack@gmail.com"
  88. history = system.get_history(patient_email)
  89. assert(len(history) > 0)
  90.  
  91. def test_history_3():
  92. patient_email = "hao@gmail.com"
  93. history = system.get_history(patient_email)
  94. assert(len(history) > 0)
  95.  
  96. def test_history_4():
  97. patient_email = "toby@gmail.com"
  98. history = system.get_history(patient_email)
  99. assert(len(history) == 0)
  100.  
  101. def test_history_5():
  102. patient_email = "gary@gmail.com"
  103. history = system.get_history(patient_email)
  104. assert(len(history) == 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement