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
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
def test_mark_entries(self, entries, index): HarProcessor().mark_entries(entries) assert entries[index]['detectem']['type'] == MAIN_ENTRY
def test__get_location(self, entry, result): assert HarProcessor._get_location(entry) == result
def test__set_entry_type(self): data = {} HarProcessor._set_entry_type(data, 'marker') assert data['detectem']['type'] == 'marker'
def test_mark_entries(self, entries, index): HarProcessor().mark_entries(entries) assert entries[index]["detectem"]["type"] == MAIN_ENTRY
def test__set_entry_type(self): data = {} HarProcessor._set_entry_type(data, "marker") assert data["detectem"]["type"] == "marker"