def list_courses(self): self.browser.open(self.base_url) response = self.browser.response.text courses = helpers.get_courses_from_json(response) return courses
def test_courses_from_json(): course_json = '{"my_courses": [{"course_path": "/courses/creative-applications-of-deep-learning-with-tensorflow-i"}]}' courses = helpers.get_courses_from_json(course_json) assert courses == [ "/courses/creative-applications-of-deep-learning-with-tensorflow-i" ]
def test_courses_from_json(): course_json = '{"courses": [{"course_path": "/courses/creative-applications-of-deep-learning-with-tensorflow-i"}]}' courses = helpers.get_courses_from_json(course_json) assert courses == ["/courses/creative-applications-of-deep-learning-with-tensorflow-i"]