How to use vininfo - 10 common examples

To help you get started, we’ve selected a few vininfo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github idlesign / vininfo / tests / test_module.py View on Github external
def test_unsupported_brand():

    vin = Vin('200BL8EV9AX604020')
    assert vin.manufacturer == 'UnsupportedBrand'
    assert vin.country == 'Canada'
github idlesign / vininfo / tests / test_module.py View on Github external
def test_validation():

    with pytest.raises(ValidationError):
         Vin('tooshort')

    with pytest.raises(ValidationError):
         Vin('AAAAAAAAAAAAAAAAO')
github idlesign / vininfo / tests / test_renault.py View on Github external
def test_renault():

    vin = Vin('VF14SRAP451234567')

    assert '%s' % vin
    assert vin.wmi == 'VF1'
    assert vin.manufacturer == 'Renault'
    assert vin.vds == '4SRAP4'
    assert vin.vis == '51234567'
    assert vin.years == [2005]
    assert vin.region_code == 'V'
    assert vin.region == 'Europe'
    assert vin.country_code == 'VF'
    assert vin.country == 'France'
    assert '%s' % vin.brand == 'Renault (Renault)'

    details = vin.details
    assert not details.engine
    assert details.model
github idlesign / vininfo / tests / test_opel.py View on Github external
def test_opel():

    vin = Vin('W0LPC6DB3CC123456')

    assert '%s' % vin
    assert vin.wmi == 'W0L'
    assert vin.manufacturer == 'Opel/Vauxhall'
    assert vin.vds == 'PC6DB3'
    assert vin.vis == 'CC123456'
    assert vin.years == [2012, 1982]
    assert vin.region_code == 'W'
    assert vin.region == 'Europe'
    assert vin.country_code == 'W0'
    assert vin.country == 'Germany/West Germany'
    assert '%s' % vin.brand == 'Opel (Opel/Vauxhall)'

    details = vin.details
    assert details.model.code == 'P'
    assert details.model.name == ['Astra J', 'Zafira C']
github idlesign / vininfo / tests / test_lada.py View on Github external
def test_lada():

    vin = Vin('XTAGFK330JY144213')

    assert '%s' % vin
    assert vin.wmi == 'XTA'
    assert vin.manufacturer == 'AvtoVAZ'
    assert vin.vds == 'GFK330'
    assert vin.vis == 'JY144213'
    assert vin.years == [2018, 1988]
    assert vin.region_code == 'X'
    assert vin.region == 'Europe'
    assert vin.country_code == 'XT'
    assert vin.country == 'USSR/CIS'
    assert vin.annotate() == OrderedDict([
        ('Country', 'USSR/CIS'),
        ('Manufacturer', 'AvtoVAZ'),
        ('Region', 'Europe'),
        ('Years', '2018, 1988'),
github idlesign / vininfo / tests / test_renault.py View on Github external
def test_bogus():
    vin = Vin('VF1KG1PBE34488860')
    details = vin.details
    assert details.engine.code == ''
    assert not details.engine
github idlesign / vininfo / tests / test_nissan.py View on Github external
def test_nissan():

    vin = Vin('5N1NJ01CXST000001')

    assert '%s' % vin
    assert vin.wmi == '5N1'
    assert vin.manufacturer == 'Nissan'
    assert vin.vds == 'NJ01CX'
    assert vin.vis == 'ST000001'
    assert vin.years == [1995]
    assert vin.region_code == '5'
    assert vin.region == 'North America'
    assert vin.country_code == '5N'
    assert vin.country == 'United States'
    assert '%s' % vin.brand == 'Nissan (Nissan)'

    details = vin.details
    assert details.model.code == 'J'
    assert details.model.name == 'Maxima'
github idlesign / vininfo / tests / test_module.py View on Github external
def test_checksum():

    assert Vin('1M8GDM9AXKP042788').verify_checksum()

    # faked
    assert not Vin('1M8GDM9AyKP042788').verify_checksum()
github idlesign / vininfo / tests / test_module.py View on Github external
def test_basic():

    # number faked
    vin = Vin('JSA12345678901234')
    assert vin.manufacturer == 'Suzuki'
    assert not vin.manufacturer_is_small

    # number faked
    assert Vin('TM912345678901234').manufacturer_is_small
github idlesign / vininfo / tests / test_module.py View on Github external
def test_validation():

    with pytest.raises(ValidationError):
         Vin('tooshort')

    with pytest.raises(ValidationError):
         Vin('AAAAAAAAAAAAAAAAO')