def test_uuid():

    assert hug.types.uuid('{12345678-1234-5678-1234-567812345678}') == UUID('12345678-1234-5678-1234-567812345678')
    assert hug.types.uuid('12345678-1234-5678-1234-567812345678') == UUID('12345678123456781234567812345678')
    assert hug.types.uuid('12345678123456781234567812345678') == UUID('12345678-1234-5678-1234-567812345678')
    assert hug.types.uuid('urn:uuid:12345678-1234-5678-1234-567812345678') == \
           UUID('12345678-1234-5678-1234-567812345678')

    with pytest.raises(ValueError):
        hug.types.uuid(1)

    with pytest.raises(ValueError):
        # Invalid HEX character
        hug.types.uuid('12345678-1234-5678-1234-56781234567G')

    with pytest.raises(ValueError):
        # One character added
        hug.types.uuid('12345678-1234-5678-1234-5678123456781')
    with pytest.raises(ValueError):
        # One character removed
        hug.types.uuid('12345678-1234-5678-1234-56781234567')
Verify that C{detached} is called when C{_athenaDetachServer} is
dataset/ETHPy150Open timothycrosley/hug/tests/test_types.py/test_uuid--crossover with--dataset/ETHPy150Open twisted/nevow/nevow/test/test_athena.py/LiveMixinTestsMixin.test_localDetachCallback