

def test_migrate(self):
    for obj in self.legacy_objs:
        guid_obj = Guid.load(obj._id)
        assert_equal(guid_obj.referent, nobjs)
    nobjs = OsfStorageGuidFile.find().count()
    main(dry_run=False)
    Guid._clear_caches()
    for obj in self.legacy_objs:
        guid_obj = Guid.load(obj._id)
        assert_not_equal(guid_obj.referent, obj)
        assert_true(isinstance(guid_obj.referent, OsfStorageGuidFile))
        assert_equal(guid_obj.referent.node, self.project)
        assert_equal(guid_obj.referent.path, obj.name)
        assert_equal(guid_obj.referent._id, obj._id)
    assert_equal(OsfStorageGuidFile.find().count(), (nobjs + 3))
    main(dry_run=False)
    assert_equal(OsfStorageGuidFile.find().count(), (nobjs + 3))

dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/osfstorage/migrate_guids.py TestMigrateGuids.test_migrate/VarMisuse@36/48 `obj`->`nobjs`