def test_no_parent():
    from kivy.uix.widget import Widget
    from kivy_garden.draggable import \
        save_widget_location, restore_widget_location
    w = Widget()
    location = save_widget_location(w)
    assert location == {
        'x': 0,
        'y': 0,
        'width': 100,
        'height': 100,
        'size_hint_x': 1,
        'size_hint_y': 1,
        'pos_hint': {},
        'size_hint_min_x': None,
        'size_hint_min_y': None,
        'size_hint_max_x': None,
        'size_hint_max_y': None,
    }
    w.pos = [
        20,
        20,
    ]
    w.size = [
        40,
        40,
    ]
    w.size_hint = [
        None,
        None,
    ]
    w.pos_hint = {
        'x': 1,
        'top': .5,
    }
    w.size_hint_min = [
        30,
        30,
    ]
    w.size_hint_max = [
        70,
        70,
    ]
    restore_widget_location(w, location)
    assert w.size == [
        100,
        100,
    ]
    assert w.pos == [
        0,
        0,
    ]
    assert w.size_hint == [
        1,
        1,
    ]
    assert w.pos_hint == {}
    assert w.size_hint_min == [
        None,
        None,
    ]
    assert w.size_hint_max == [
        None,
        None,
    ]