Beispiel #1
0
def test_Dataset_addFlatSFtoDataframe_exceptions(mockTree, mocker):
    newDataset = Dataset("someName")
    inputDF = copy.deepcopy(mockTree.dataframe)
    with pytest.raises(RuntimeError):
        newDataset.addFlatSFtoDataframe(inputDF)
    
    with pytest.raises(TypeError):
        newDataset.setSF("Hallo", "OkayName")
    with pytest.raises(TypeError):
        newDataset.setSF(1.2, [])
Beispiel #2
0
def test_Dataset_addFlatSFtoDataframe(mockTree, mocker):
    SFName = "flatSF"
    SF = 1.2
    inputDF = copy.deepcopy(mockTree.dataframe)
    expected = copy.deepcopy(mockTree.dataframe)
    expected["flatSF"] = len(expected)*[SF]
    print(expected)

    newDataset = Dataset("someName")
    newDataset.setSF(SF, SFName)
    newDataset.addFlatSFtoDataframe(inputDF)
    assert expected.equals(inputDF)