def test_parse_junk_dom_ria_flat_emptiness( dom_ria_flat_parser: DomRiaFlatParser): assert None is dom_ria_flat_parser.parse_junk( { 'url': 'https://dom.ria.com/uk/realty-perevireno-prodaja-kvartira-' 'odessa-primorskiy-italyanskiy-bulvar-15546830.html', 'markup': read('fixtures/test_parse_junk/dom_ria_flat3.html') }) assert dom_ria_flat_parser.parse_junk({}) is None assert dom_ria_flat_parser.parse_junk(None) is None # noqa
def test_parse_junk_dom_ria_flat(dom_ria_flat_parser: DomRiaFlatParser): assert dom_ria_flat_parser.parse_junk({ 'url': 'https://dom.ria.com/uk/realty-prodaja-kvartira' '-kiev-goloseevskiy-15695319.html', 'markup': read('fixtures/test_parse_junk/dom_ria_flat0.html') }) == 'https://dom.ria.com/uk/realty-prodaja-' \ 'kvartira-kiev-goloseevskiy-15695319.html' assert dom_ria_flat_parser.parse_junk({ 'url': 'https://dom.ria.com/uk/realty-prodaja-kvartira-odessa-' 'kievskiy-lyustdorfskaya-dor-chernomorskaya-dor-15699660.html', 'markup': read('fixtures/test_parse_junk/dom_ria_flat1.html') }) == 'https://dom.ria.com/uk/realty-prodaja-kvartira-odessa-' \ 'kievskiy-lyustdorfskaya-dor-chernomorskaya-dor-15699660.html' assert dom_ria_flat_parser.parse_junk({ 'url': 'https://dom.ria.com/uk/realty-prodaja-kvartira' '-odessa-malinovskiy-komarova-15699670.html', 'markup': read('fixtures/test_parse_junk/dom_ria_flat2.html') }) == 'https://dom.ria.com/uk/realty-prodaja-kvartira-' \ 'odessa-malinovskiy-komarova-15699670.html'