Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
 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" ]
     })
Exemple #4
0
 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"]
     })
Exemple #5
0
    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)
Exemple #6
0
 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"]
     })
Exemple #7
0
    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)
Exemple #8
0
 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" ]
     })
Exemple #9
0
 def test_extract_properties_none(self):
     raw_html = """hemene, hemene"""
     self.assertEquals(text.extract_properties(raw_html), {})
Exemple #10
0
 def test_extract_properties_none(self):
     raw_html = """hemene, hemene"""
     self.assertEquals(text.extract_properties(raw_html), {})