def test_no_scheme_domain_level(self): message = Message() message.url = "yandex.ru/qweqwe/" message = self.stage.do_stage(message) self.assertEqual(2, message.results['mongo_extra']['domain_level'])
def test_ex3_domain_name(self): message = Message() message.url = "yandex.ru/qwe/qwe/" message = self.stage.do_stage(message) self.assertEqual("yandex.ru", message.results['mongo_extra']['domain'])
def test_1l_no_right_slash_domain_level(self): message = Message() message.url = "http://yandex.ru" message = self.stage.do_stage(message) self.assertEqual(1,message.results['mongo_extra']['domain_level'])