コード例 #1
0
class TestParamParser(unittest.TestCase):
    def setUp(self):
        self.parser = ParamParser()
        self.parser.feed(SearchPageResponse.RESPONSE)

    def test_it_parses_event_target(self):
        assert self.parser.event_target == "bleh"

    def test_it_parses_event_argument(self):
        assert self.parser.event_argument == "boo"

    def test_it_parses_view_state(self):
        assert self.parser.view_state == "billy bob"

    def test_it_parses_view_state_generator(self):
        assert self.parser.view_state_generator == "thornton"

    def test_it_parses_event_validation(self):
        assert self.parser.event_validation == "validate"

    def test_it_parses_node_id(self):
        assert self.parser.node_id == "a lot of nodes"
コード例 #2
0
 def __extract_payload(node_response, last_name, first_name, middle_name,
                       birth_date):
     param_parser = ParamParser()
     param_parser.feed(node_response.text)
     return Payload.payload(param_parser, last_name, first_name,
                            middle_name, birth_date)
コード例 #3
0
 def setUp(self):
     self.parser = ParamParser()
     self.parser.feed(SearchPageResponse.RESPONSE)