Ejemplo n.º 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)
Ejemplo n.º 2
0
Archivo: app.py Proyecto: strk/cartman
    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)
Ejemplo n.º 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" ]
     })
Ejemplo n.º 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"]
     })
Ejemplo n.º 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)
Ejemplo n.º 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"]
     })
Ejemplo n.º 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)
Ejemplo n.º 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" ]
     })
Ejemplo n.º 9
0
 def test_extract_properties_none(self):
     raw_html = """hemene, hemene"""
     self.assertEquals(text.extract_properties(raw_html), {})
Ejemplo n.º 10
0
 def test_extract_properties_none(self):
     raw_html = """hemene, hemene"""
     self.assertEquals(text.extract_properties(raw_html), {})