def test_get_settings_from_pr_body(self): """ Extract settings from a string containing settings """ settings_str = 'TEST: true\r\nother: false\r\n' pr_body = "Description\r\nover\r\nlines\r\n- - -\r\n**Settings**\r\n```yaml\r\n" + settings_str + "```" self.assertEqual(github.get_settings_from_pr_body(pr_body), settings_str)
def test_get_settings_from_pr_body_not_contain(self): """ Extract settings from a string which doesn't contain settings """ pr_body = "Description\r\nover\r\nlines\r\n- - -\r\n**Settings**\r\nMALFORMED" self.assertEqual(github.get_settings_from_pr_body(pr_body), '')