|
| 1 | +import pytest |
| 2 | + |
| 3 | + |
| 4 | +def test_basic_math(run_script, expect_variables): |
| 5 | + _, namespace = run_script("math_and_comparisons_solution.py") |
| 6 | + expect_variables( |
| 7 | + namespace, |
| 8 | + {"addition": 15, "substraction": -5, "multiplication": 50, "division": 0.5}, |
| 9 | + ) |
| 10 | + |
| 11 | + |
| 12 | +@pytest.mark.skip(reason="Finish earlier task first") |
| 13 | +def test_string_concat(run_script, expect_variables): |
| 14 | + _, namespace = run_script("math_and_comparisons_solution.py") |
| 15 | + expect_variables(namespace, {"concat_name": "JaneDoe"}) |
| 16 | + |
| 17 | + |
| 18 | +@pytest.mark.skip(reason="Finish earlier task first") |
| 19 | +def test_string_indexing(run_script, expect_variables): |
| 20 | + _, namespace = run_script("math_and_comparisons_solution.py") |
| 21 | + expect_variables(namespace, {"first_letter": "M", "second_last_letter": "o"}) |
| 22 | + |
| 23 | + |
| 24 | +@pytest.mark.skip(reason="Finish earlier task first") |
| 25 | +def test_convert_case(run_script, expect_variables): |
| 26 | + TEST_STRING = "HeLLo AND WelcomE" |
| 27 | + _, namespace = run_script("math_and_comparisons_solution.py") |
| 28 | + expect_variables( |
| 29 | + namespace, |
| 30 | + { |
| 31 | + "lowercased": TEST_STRING.lower(), |
| 32 | + "uppercased": TEST_STRING.upper(), |
| 33 | + "titlecased": TEST_STRING.title(), |
| 34 | + }, |
| 35 | + ) |
0 commit comments