コード例 #1
0
    def test__script_to_har_entry(self):
        url = 'http://url'
        content = 'content'

        entry = HarProcessor._script_to_har_entry(content, url)
        assert entry['request']['url'] == url
        assert entry['response']['url'] == url
        assert entry['response']['content']['text'] == content

        assert entry['detectem']['type'] == INLINE_SCRIPT_ENTRY
コード例 #2
0
    def test__script_to_har_entry(self):
        url = "http://url"
        content = "content"

        entry = HarProcessor._script_to_har_entry(content, url)
        assert entry["request"]["url"] == url
        assert entry["response"]["url"] == url
        assert entry["response"]["content"]["text"] == content

        assert entry["detectem"]["type"] == INLINE_SCRIPT_ENTRY
コード例 #3
0
 def test_mark_entries(self, entries, index):
     HarProcessor().mark_entries(entries)
     assert entries[index]['detectem']['type'] == MAIN_ENTRY
コード例 #4
0
 def test__get_location(self, entry, result):
     assert HarProcessor._get_location(entry) == result
コード例 #5
0
 def test__set_entry_type(self):
     data = {}
     HarProcessor._set_entry_type(data, 'marker')
     assert data['detectem']['type'] == 'marker'
コード例 #6
0
 def test_mark_entries(self, entries, index):
     HarProcessor().mark_entries(entries)
     assert entries[index]["detectem"]["type"] == MAIN_ENTRY
コード例 #7
0
 def test__set_entry_type(self):
     data = {}
     HarProcessor._set_entry_type(data, "marker")
     assert data["detectem"]["type"] == "marker"