Advertisement
Guest User

Untitled

a guest
Jul 16th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.56 KB | None | 0 0
  1. $ python -m pytest test_workouts.py            
  2. ============================= test session starts ==============================
  3. platform linux -- Python 3.8.3, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
  4. rootdir: /home/<user>/dev/projects/python/2018-and-2020/bitesofpy/Intro-freebies-101-110/inprogress/Bite 109 - Workout dict lookups and raising an exception
  5. collected 13 items                                                            
  6.  
  7. test_workouts.py FFFFFFFFFFF..                                           [100%]
  8.  
  9. =================================== FAILURES ===================================
  10. _ test_get_workout_valid_case_insensitive_dict_lookups[Monday-Go train Chest+biceps] _
  11.  
  12. day = 'Monday', expected = 'Go train Chest+biceps'
  13.  
  14.     @pytest.mark.parametrize("day, expected", [
  15.         ('Monday', 'Go train Chest+biceps'),
  16.         ('monday', 'Go train Chest+biceps'),
  17.         ('Tuesday', 'Go train Back+triceps'),
  18.         ('TuEsdAy', 'Go train Back+triceps'),
  19.         ('Wednesday', 'Go train Core'),
  20.         ('wednesdaY', 'Go train Core'),
  21.         ('Thursday', 'Go train Legs'),
  22.         ('Friday', 'Go train Shoulders'),
  23.         ('Saturday', CHILL_OUT),
  24.         ('Sunday', CHILL_OUT),
  25.         ('sundAy', CHILL_OUT),
  26.         ('nonsense', INVALID_DAY),
  27.         ('monday2', INVALID_DAY),
  28.     ])
  29.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  30. >       assert get_workout_motd(day) == expected
  31. E       AssertionError: assert 'Not a valid day' == 'Go train Chest+biceps'
  32. E         - Go train Chest+biceps
  33. E         + Not a valid day
  34.  
  35. test_workouts.py:23: AssertionError
  36. _ test_get_workout_valid_case_insensitive_dict_lookups[monday-Go train Chest+biceps] _
  37.  
  38. day = 'monday', expected = 'Go train Chest+biceps'
  39.  
  40.     @pytest.mark.parametrize("day, expected", [
  41.         ('Monday', 'Go train Chest+biceps'),
  42.         ('monday', 'Go train Chest+biceps'),
  43.         ('Tuesday', 'Go train Back+triceps'),
  44.         ('TuEsdAy', 'Go train Back+triceps'),
  45.         ('Wednesday', 'Go train Core'),
  46.         ('wednesdaY', 'Go train Core'),
  47.         ('Thursday', 'Go train Legs'),
  48.         ('Friday', 'Go train Shoulders'),
  49.         ('Saturday', CHILL_OUT),
  50.         ('Sunday', CHILL_OUT),
  51.         ('sundAy', CHILL_OUT),
  52.         ('nonsense', INVALID_DAY),
  53.         ('monday2', INVALID_DAY),
  54.     ])
  55.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  56. >       assert get_workout_motd(day) == expected
  57. E       AssertionError: assert 'Not a valid day' == 'Go train Chest+biceps'
  58. E         - Go train Chest+biceps
  59. E         + Not a valid day
  60.  
  61. test_workouts.py:23: AssertionError
  62. _ test_get_workout_valid_case_insensitive_dict_lookups[Tuesday-Go train Back+triceps] _
  63.  
  64. day = 'Tuesday', expected = 'Go train Back+triceps'
  65.  
  66.     @pytest.mark.parametrize("day, expected", [
  67.         ('Monday', 'Go train Chest+biceps'),
  68.         ('monday', 'Go train Chest+biceps'),
  69.         ('Tuesday', 'Go train Back+triceps'),
  70.         ('TuEsdAy', 'Go train Back+triceps'),
  71.         ('Wednesday', 'Go train Core'),
  72.         ('wednesdaY', 'Go train Core'),
  73.         ('Thursday', 'Go train Legs'),
  74.         ('Friday', 'Go train Shoulders'),
  75.         ('Saturday', CHILL_OUT),
  76.         ('Sunday', CHILL_OUT),
  77.         ('sundAy', CHILL_OUT),
  78.         ('nonsense', INVALID_DAY),
  79.         ('monday2', INVALID_DAY),
  80.     ])
  81.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  82. >       assert get_workout_motd(day) == expected
  83. E       AssertionError: assert 'Not a valid day' == 'Go train Back+triceps'
  84. E         - Go train Back+triceps
  85. E         + Not a valid day
  86.  
  87. test_workouts.py:23: AssertionError
  88. _ test_get_workout_valid_case_insensitive_dict_lookups[TuEsdAy-Go train Back+triceps] _
  89.  
  90. day = 'TuEsdAy', expected = 'Go train Back+triceps'
  91.  
  92.     @pytest.mark.parametrize("day, expected", [
  93.         ('Monday', 'Go train Chest+biceps'),
  94.         ('monday', 'Go train Chest+biceps'),
  95.         ('Tuesday', 'Go train Back+triceps'),
  96.         ('TuEsdAy', 'Go train Back+triceps'),
  97.         ('Wednesday', 'Go train Core'),
  98.         ('wednesdaY', 'Go train Core'),
  99.         ('Thursday', 'Go train Legs'),
  100.         ('Friday', 'Go train Shoulders'),
  101.         ('Saturday', CHILL_OUT),
  102.         ('Sunday', CHILL_OUT),
  103.         ('sundAy', CHILL_OUT),
  104.         ('nonsense', INVALID_DAY),
  105.         ('monday2', INVALID_DAY),
  106.     ])
  107.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  108. >       assert get_workout_motd(day) == expected
  109. E       AssertionError: assert 'Not a valid day' == 'Go train Back+triceps'
  110. E         - Go train Back+triceps
  111. E         + Not a valid day
  112.  
  113. test_workouts.py:23: AssertionError
  114. _ test_get_workout_valid_case_insensitive_dict_lookups[Wednesday-Go train Core] _
  115.  
  116. day = 'Wednesday', expected = 'Go train Core'
  117.  
  118.     @pytest.mark.parametrize("day, expected", [
  119.         ('Monday', 'Go train Chest+biceps'),
  120.         ('monday', 'Go train Chest+biceps'),
  121.         ('Tuesday', 'Go train Back+triceps'),
  122.         ('TuEsdAy', 'Go train Back+triceps'),
  123.         ('Wednesday', 'Go train Core'),
  124.         ('wednesdaY', 'Go train Core'),
  125.         ('Thursday', 'Go train Legs'),
  126.         ('Friday', 'Go train Shoulders'),
  127.         ('Saturday', CHILL_OUT),
  128.         ('Sunday', CHILL_OUT),
  129.         ('sundAy', CHILL_OUT),
  130.         ('nonsense', INVALID_DAY),
  131.         ('monday2', INVALID_DAY),
  132.     ])
  133.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  134. >       assert get_workout_motd(day) == expected
  135. E       AssertionError: assert 'Not a valid day' == 'Go train Core'
  136. E         - Go train Core
  137. E         + Not a valid day
  138.  
  139. test_workouts.py:23: AssertionError
  140. _ test_get_workout_valid_case_insensitive_dict_lookups[wednesdaY-Go train Core] _
  141.  
  142. day = 'wednesdaY', expected = 'Go train Core'
  143.  
  144.     @pytest.mark.parametrize("day, expected", [
  145.         ('Monday', 'Go train Chest+biceps'),
  146.         ('monday', 'Go train Chest+biceps'),
  147.         ('Tuesday', 'Go train Back+triceps'),
  148.         ('TuEsdAy', 'Go train Back+triceps'),
  149.         ('Wednesday', 'Go train Core'),
  150.         ('wednesdaY', 'Go train Core'),
  151.         ('Thursday', 'Go train Legs'),
  152.         ('Friday', 'Go train Shoulders'),
  153.         ('Saturday', CHILL_OUT),
  154.         ('Sunday', CHILL_OUT),
  155.         ('sundAy', CHILL_OUT),
  156.         ('nonsense', INVALID_DAY),
  157.         ('monday2', INVALID_DAY),
  158.     ])
  159.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  160. >       assert get_workout_motd(day) == expected
  161. E       AssertionError: assert 'Not a valid day' == 'Go train Core'
  162. E         - Go train Core
  163. E         + Not a valid day
  164.  
  165. test_workouts.py:23: AssertionError
  166. _ test_get_workout_valid_case_insensitive_dict_lookups[Thursday-Go train Legs] _
  167.  
  168. day = 'Thursday', expected = 'Go train Legs'
  169.  
  170.     @pytest.mark.parametrize("day, expected", [
  171.         ('Monday', 'Go train Chest+biceps'),
  172.         ('monday', 'Go train Chest+biceps'),
  173.         ('Tuesday', 'Go train Back+triceps'),
  174.         ('TuEsdAy', 'Go train Back+triceps'),
  175.         ('Wednesday', 'Go train Core'),
  176.         ('wednesdaY', 'Go train Core'),
  177.         ('Thursday', 'Go train Legs'),
  178.         ('Friday', 'Go train Shoulders'),
  179.         ('Saturday', CHILL_OUT),
  180.         ('Sunday', CHILL_OUT),
  181.         ('sundAy', CHILL_OUT),
  182.         ('nonsense', INVALID_DAY),
  183.         ('monday2', INVALID_DAY),
  184.     ])
  185.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  186. >       assert get_workout_motd(day) == expected
  187. E       AssertionError: assert 'Not a valid day' == 'Go train Legs'
  188. E         - Go train Legs
  189. E         + Not a valid day
  190.  
  191. test_workouts.py:23: AssertionError
  192. _ test_get_workout_valid_case_insensitive_dict_lookups[Friday-Go train Shoulders] _
  193.  
  194. day = 'Friday', expected = 'Go train Shoulders'
  195.  
  196.     @pytest.mark.parametrize("day, expected", [
  197.         ('Monday', 'Go train Chest+biceps'),
  198.         ('monday', 'Go train Chest+biceps'),
  199.         ('Tuesday', 'Go train Back+triceps'),
  200.         ('TuEsdAy', 'Go train Back+triceps'),
  201.         ('Wednesday', 'Go train Core'),
  202.         ('wednesdaY', 'Go train Core'),
  203.         ('Thursday', 'Go train Legs'),
  204.         ('Friday', 'Go train Shoulders'),
  205.         ('Saturday', CHILL_OUT),
  206.         ('Sunday', CHILL_OUT),
  207.         ('sundAy', CHILL_OUT),
  208.         ('nonsense', INVALID_DAY),
  209.         ('monday2', INVALID_DAY),
  210.     ])
  211.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  212. >       assert get_workout_motd(day) == expected
  213. E       AssertionError: assert 'Not a valid day' == 'Go train Shoulders'
  214. E         - Go train Shoulders
  215. E         + Not a valid day
  216.  
  217. test_workouts.py:23: AssertionError
  218. __ test_get_workout_valid_case_insensitive_dict_lookups[Saturday-Chill out!] ___
  219.  
  220. day = 'Saturday', expected = 'Chill out!'
  221.  
  222.     @pytest.mark.parametrize("day, expected", [
  223.         ('Monday', 'Go train Chest+biceps'),
  224.         ('monday', 'Go train Chest+biceps'),
  225.         ('Tuesday', 'Go train Back+triceps'),
  226.         ('TuEsdAy', 'Go train Back+triceps'),
  227.         ('Wednesday', 'Go train Core'),
  228.         ('wednesdaY', 'Go train Core'),
  229.         ('Thursday', 'Go train Legs'),
  230.         ('Friday', 'Go train Shoulders'),
  231.         ('Saturday', CHILL_OUT),
  232.         ('Sunday', CHILL_OUT),
  233.         ('sundAy', CHILL_OUT),
  234.         ('nonsense', INVALID_DAY),
  235.         ('monday2', INVALID_DAY),
  236.     ])
  237.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  238. >       assert get_workout_motd(day) == expected
  239. E       AssertionError: assert 'Not a valid day' == 'Chill out!'
  240. E         - Chill out!
  241. E         + Not a valid day
  242.  
  243. test_workouts.py:23: AssertionError
  244. ___ test_get_workout_valid_case_insensitive_dict_lookups[Sunday-Chill out!] ____
  245.  
  246. day = 'Sunday', expected = 'Chill out!'
  247.  
  248.     @pytest.mark.parametrize("day, expected", [
  249.         ('Monday', 'Go train Chest+biceps'),
  250.         ('monday', 'Go train Chest+biceps'),
  251.         ('Tuesday', 'Go train Back+triceps'),
  252.         ('TuEsdAy', 'Go train Back+triceps'),
  253.         ('Wednesday', 'Go train Core'),
  254.         ('wednesdaY', 'Go train Core'),
  255.         ('Thursday', 'Go train Legs'),
  256.         ('Friday', 'Go train Shoulders'),
  257.         ('Saturday', CHILL_OUT),
  258.         ('Sunday', CHILL_OUT),
  259.         ('sundAy', CHILL_OUT),
  260.         ('nonsense', INVALID_DAY),
  261.         ('monday2', INVALID_DAY),
  262.     ])
  263.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  264. >       assert get_workout_motd(day) == expected
  265. E       AssertionError: assert 'Not a valid day' == 'Chill out!'
  266. E         - Chill out!
  267. E         + Not a valid day
  268.  
  269. test_workouts.py:23: AssertionError
  270. ___ test_get_workout_valid_case_insensitive_dict_lookups[sundAy-Chill out!] ____
  271.  
  272. day = 'sundAy', expected = 'Chill out!'
  273.  
  274.     @pytest.mark.parametrize("day, expected", [
  275.         ('Monday', 'Go train Chest+biceps'),
  276.         ('monday', 'Go train Chest+biceps'),
  277.         ('Tuesday', 'Go train Back+triceps'),
  278.         ('TuEsdAy', 'Go train Back+triceps'),
  279.         ('Wednesday', 'Go train Core'),
  280.         ('wednesdaY', 'Go train Core'),
  281.         ('Thursday', 'Go train Legs'),
  282.         ('Friday', 'Go train Shoulders'),
  283.         ('Saturday', CHILL_OUT),
  284.         ('Sunday', CHILL_OUT),
  285.         ('sundAy', CHILL_OUT),
  286.         ('nonsense', INVALID_DAY),
  287.         ('monday2', INVALID_DAY),
  288.     ])
  289.     def test_get_workout_valid_case_insensitive_dict_lookups(day, expected):
  290. >       assert get_workout_motd(day) == expected
  291. E       AssertionError: assert 'Not a valid day' == 'Chill out!'
  292. E         - Chill out!
  293. E         + Not a valid day
  294.  
  295. test_workouts.py:23: AssertionError
  296. =========================== short test summary info ============================
  297. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Monday-Go train Chest+biceps]
  298. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[monday-Go train Chest+biceps]
  299. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Tuesday-Go train Back+triceps]
  300. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[TuEsdAy-Go train Back+triceps]
  301. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Wednesday-Go train Core]
  302. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[wednesdaY-Go train Core]
  303. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Thursday-Go train Legs]
  304. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Friday-Go train Shoulders]
  305. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Saturday-Chill out!]
  306. FAILED test_workouts.py::test_get_workout_valid_case_insensitive_dict_lookups[Sunday-Chill out!]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement