Beispiel #1
0
def test_addAndRemoveStorageOccupancy():

    # just inserting one record
    record = createStorageOccupancyAccountingRecord()
    record.setStartTime()
    record.setEndTime()
    res = gDataStoreClient.addRegister(record)
    assert res["OK"]
    res = gDataStoreClient.commit()
    assert res["OK"]

    rc = ReportsClient()

    res = rc.listReports("StorageOccupancy")
    assert res["OK"]

    res = rc.listUniqueKeyValues("StorageOccupancy")
    assert res["OK"]

    res = rc.getReport(
        "StorageOccupancy",
        "Free and Used Space",
        datetime.datetime.utcnow(),
        datetime.datetime.utcnow(),
        {},
        "StorageElement",
    )
    assert res["OK"]

    # now removing that record
    res = gDataStoreClient.remove(record)
    assert res["OK"]
Beispiel #2
0
def test_addAndRemoveStorageOccupancy():

    # just inserting one record
    record = createStorageOccupancyAccountingRecord()
    record.setStartTime()
    record.setEndTime()
    res = gDataStoreClient.addRegister(record)
    assert res['OK']
    res = gDataStoreClient.commit()
    assert res['OK']
    # now removing that record
    res = gDataStoreClient.remove(record)
    assert res['OK']