Exemplo n.º 1
0
def test_setting_external_updates_in_track_object_and_database(
        peewee_database_storage):
    from cozy.db.storage import Storage as StorageModel
    from cozy.model.storage import Storage

    new_external = True

    storage = Storage(peewee_database_storage, 1)
    storage.external = new_external
    assert storage.external == new_external
    assert StorageModel.get_by_id(1).external == new_external
Exemplo n.º 2
0
def test_setting_location_type_updates_in_track_object_and_database(
        peewee_database_storage):
    from cozy.db.storage import Storage as StorageModel
    from cozy.model.storage import Storage

    new_location_type = 555

    storage = Storage(peewee_database_storage, 1)
    storage.location_type = new_location_type
    assert storage.location_type == new_location_type
    assert StorageModel.get_by_id(1).location_type == new_location_type
Exemplo n.º 3
0
def test_setting_default_updates_in_track_object_and_database(
        peewee_database_storage):
    from cozy.db.storage import Storage as StorageModel
    from cozy.model.storage import Storage

    new_default = True

    storage = Storage(peewee_database_storage, 1)
    storage.default = new_default
    assert storage.default == new_default
    assert StorageModel.get_by_id(1).default == new_default
Exemplo n.º 4
0
def test_setting_path_updates_in_track_object_and_database(
        peewee_database_storage):
    from cozy.db.storage import Storage as StorageModel
    from cozy.model.storage import Storage

    new_path = "/tmp/media2"

    storage = Storage(peewee_database_storage, 1)
    storage.path = new_path
    assert storage.path == new_path
    assert StorageModel.get_by_id(1).path == new_path