def _get_properties(self): """Return all the values typically used in drop-downs on the create ticket page, such as Milestones, Versions, etc. These lists are extracted from the JavaScript dictionary exposed on the query page. """ return text.extract_properties(self.get("/query").text)
def get_properties(self): """Return the values used in drop-downs on the create ticket page. The lists such as Milestones and Versions are extracted from a JavaScript dictionary exposed on the query page. """ return text.extract_properties(self.get("/query").text)
def test_extract_properties_found(self): raw_html = """hemene, hemene var properties={ "another": "one", "bites": ["the", "dust"] }; """ self.assertEquals(text.extract_properties(raw_html), { "another": "one", "bites": [ "the", "dust" ] })
def test_extract_properties_found(self): raw_html = """hemene, hemene var properties={ "another": "one", "bites": ["the", "dust"] }; var modes={}; """ self.assertEquals(text.extract_properties(raw_html), { "another": "one", "bites": ["the", "dust"] })
def get_properties(self): """Return the values used in drop-downs on the create ticket page. The lists such as Milestones and Versions are extracted from a JavaScript dictionary exposed on the query page. """ # NOTE: lack of "order" parameter disables "max" request too r = self.get("/query?max=1&order=priority") return text.extract_properties(r.text)
def test_extract_properties_found_with_semicolon(self): raw_html = """hemene, hemene var properties={ "another": "one", "bites": ["the", "d;ust"] }; var modes={}; </script>Other; semi-colons; to make sure; we don't break. """ self.assertEquals(text.extract_properties(raw_html), { "another": "one", "bites": ["the", "d;ust"] })
def test_extract_properties_found_with_semicolon(self): raw_html = """hemene, hemene var properties={ "another": "one", "bites": ["the", "d;ust"] }; var modes={}; </script>Other; semi-colons; to make sure; we don't break. """ self.assertEquals(text.extract_properties(raw_html), { "another": "one", "bites": [ "the", "d;ust" ] })
def test_extract_properties_none(self): raw_html = """hemene, hemene""" self.assertEquals(text.extract_properties(raw_html), {})