示例#1
0
    def test_json_0_5_assertion_input(self):
        assertion_data = json.dumps(self.assertion_data)
        state = INITIAL_STATE
        action = store_input(assertion_data)
        state = main_reducer(state, action)
        self.assertEqual(state['input']['value'], assertion_data)

        task_meta = add_task(DETECT_INPUT_TYPE)
        result, message, actions = run_task(state, task_meta)
        self.assertTrue(result, "Task completes successfully")
        self.assertIn(REPORT_MESSAGE, [a.get('type') for a in actions])
示例#2
0
    def test_json_1_0_assertion_input(self):
        assertion_data = test_components['1_0_basic_assertion']
        state = INITIAL_STATE
        action = store_input(assertion_data)
        state = main_reducer(state, action)
        self.assertEqual(state['input']['value'], assertion_data)

        task_meta = add_task(DETECT_INPUT_TYPE)
        result, message, actions = run_task(state, task_meta)
        self.assertTrue(result)
        self.assertIn(SET_VALIDATION_SUBJECT, [a.get('type') for a in actions])
        self.assertIn(FETCH_HTTP_NODE, [a.get('name') for a in actions])
示例#3
0
 def test_set_input_type(self):
     self.store.dispatch(store_input("http://example.com/url1"))
     self.store.dispatch(set_input_type('url'))
     self.assertEqual(self.store.get_state().get('input').get('input_type'),
                      'url')
示例#4
0
 def test_store_input(self):
     self.store.dispatch(store_input("http://example.com/url1"))
     self.assertEqual(self.store.get_state().get('input').get('value'),
                      'http://example.com/url1')