示例#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)
示例#2
0
文件: app.py 项目: 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)
示例#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" ]
     })
示例#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"]
     })
示例#5
0
文件: app.py 项目: tamentis/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.

        """
        # NOTE: lack of "order" parameter disables "max" request too
        r = self.get("/query?max=1&order=priority")
        return text.extract_properties(r.text)
示例#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"]
     })
示例#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)
示例#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" ]
     })
示例#9
0
 def test_extract_properties_none(self):
     raw_html = """hemene, hemene"""
     self.assertEquals(text.extract_properties(raw_html), {})
示例#10
0
 def test_extract_properties_none(self):
     raw_html = """hemene, hemene"""
     self.assertEquals(text.extract_properties(raw_html), {})