def test_get_version_data():
    assert v.get_version_data("bogus", TEST_METADATA) == {
        "version": "bogus",
        "providers": [],
    }

    assert v.get_version_data("1.0.0", TEST_METADATA) == {
        "version": "1.0.0",
        "providers": [{
            "name": "virtualbox",
            "url": "http://example.com/1.0.0/virtualbox/precise64_virtualbox.box",
            "checksum_type": "sha1",
            "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
        },
        {
            "name": "vmware_desktop",
            "url": "http://example.com/1.0.0/vmware_desktop/precise64_vmware_desktop.box",
            "checksum_type": "sha1",
            "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
        }]
    }
def test_get_version_data():
    assert v.get_version_data("bogus", TEST_METADATA) == {
        "version": "bogus",
        "providers": [],
    }

    assert v.get_version_data("1.0.0", TEST_METADATA) == {
        "version":
        "1.0.0",
        "providers": [{
            "name": "virtualbox",
            "url":
            "http://example.com/1.0.0/virtualbox/precise64_virtualbox.box",
            "checksum_type": "sha1",
            "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
        }, {
            "name": "vmware_desktop",
            "url":
            "http://example.com/1.0.0/vmware_desktop/precise64_vmware_desktop.box",
            "checksum_type": "sha1",
            "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
        }]
    }
def test_get_provider_data():
    version_data = v.get_version_data("1.0.0", TEST_METADATA)

    assert v.get_provider_data("kvm", version_data) == {
        "name": "kvm",
        "checksum_type": "sha1",
        "checksum": "",
        "url": "",
    }

    assert v.get_provider_data("virtualbox", version_data) == {
        "name": "virtualbox",
        "url": "http://example.com/1.0.0/virtualbox/precise64_virtualbox.box",
        "checksum_type": "sha1",
        "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    }
def test_get_provider_data():
    version_data = v.get_version_data("1.0.0", TEST_METADATA)

    assert v.get_provider_data("kvm", version_data) == {
        "name": "kvm",
        "checksum_type": "sha1",
        "checksum": "",
        "url": "",
    }

    assert v.get_provider_data("virtualbox", version_data) == {
        "name": "virtualbox",
        "url": "http://example.com/1.0.0/virtualbox/precise64_virtualbox.box",
        "checksum_type": "sha1",
        "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    }