Example #1
0
def test_download_image(test_proxy, tmpdir):

    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    parser.download_dir = pathlib.Path(tmpdir.dirname)
    parser.get_listing("test_listing", categories[0])
    new_line = parser.download_dir.joinpath("2030520001_0.jpg")
    assert new_line.is_file() is True
Example #2
0
def test_parse_lagerort(test_proxy):
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert "Grellstraße" in listing.lagerort
    assert "10409 Berlin" in listing.lagerort
    assert "Lagerort / Standort" not in listing.lagerort
Example #3
0
def test_parse_daten(test_proxy):
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert listing.daten.get("Erstzulassung") == "09/18"
Example #4
0
def test_prase_listing_gebotsbasis(test_proxy):
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert "stück" == listing.gebotsbasis.lower()
Example #5
0
def test_parse_listing_kurzbeschreibung(test_proxy):
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert ("oft-Close-Automatik" in listing.kurzbeschreibung
            and "Frontbereich/-schiebe" in listing.kurzbeschreibung)
Example #6
0
def test_parse_listing_gebotstermin(test_proxy):
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert listing.gebotstermin == datetime(2020, 7, 24, 13, 0)
Example #7
0
def test_prase_listing_title(test_proxy):
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert listing.title == "Pkw BMW 740e iPerformance"
Example #8
0
def test_parse_listing_id(test_proxy):
    # given
    categories = [Category(id=1100, name="", is_top_level=False)]
    parser = ListingParser(test_proxy)
    listing = parser.get_listing("test_listing", categories[0])
    assert listing.id == 2030520001