def test_transform():
    data_block = create_datablock()
    fom = FigureOfMerit.FigureOfMerit(data_block)
    res = fom.transform(data_block)
    verify_products(fom, res)
    for k in expected_reply.keys():
        if k == "AWS_Price_Performance":
            df = fix_column(res[k], "AWS_Price_Performance")
            edf = fix_column(expected_reply[k], "AWS_Price_Performance")
        else:
            df = fix_column(res[k], "AWS_Figure_Of_Merit")
            edf = fix_column(expected_reply[k], "AWS_Figure_Of_Merit")
        pd.testing.assert_frame_equal(edf, df)
Ejemplo n.º 2
0
 def test_transform(self):
     data_block = create_datablock()
     fom = FigureOfMerit.FigureOfMerit(data_block)
     res = fom.transform(data_block)
     r_keys = list(res.keys()).sort()
     p_keys = produces.sort()
     assert p_keys == r_keys
     for k in expected_reply.keys():
         if k == 'AWS_Price_Performance':
             df = fix_column(res[k], 'AWS_Price_Performance')
             edf = fix_column(expected_reply[k], 'AWS_Price_Performance')
         else:
             df = fix_column(res[k], 'AWS_Figure_Of_Merit')
             edf = fix_column(expected_reply[k], 'AWS_Figure_Of_Merit')
         pd.testing.assert_frame_equal(edf, df)
Ejemplo n.º 3
0
 def test_transform(self):
     fom = FigureOfMerit.FigureOfMerit()
     data_block = create_datablock()
     res = fom.transform(data_block)
     r_keys = res.keys().sort()
     p_keys = produces.sort()
     assert p_keys == r_keys
     for k in expected_reply.keys():
         if k == 'AWS_Price_Performance':
             df = fix_column(res[k], 'AWS_Price_Performance')
             edf = fix_column(expected_reply[k], 'AWS_Price_Performance')
         else:
             df = fix_column(res[k], 'AWS_Figure_Of_Merit')
             edf = fix_column(expected_reply[k], 'AWS_Figure_Of_Merit')
         assert utils.compare_dfs(edf, df)
Ejemplo n.º 4
0
 def test_produces(self):
     fom = FigureOfMerit.FigureOfMerit(create_datablock())
     assert fom.produces() == produces
Ejemplo n.º 5
0
 def test_consumes(self):
     fom = FigureOfMerit.FigureOfMerit(create_datablock())
     assert fom.consumes() == consumes
Ejemplo n.º 6
0
 def test_produces(self):
     fom = FigureOfMerit.FigureOfMerit()
     assert fom.produces() == produces
Ejemplo n.º 7
0
 def test_consumes(self):
     fom = FigureOfMerit.FigureOfMerit()
     assert fom.consumes() == consumes