Exemple #1
0
    def test_colums(self):
        '''Test node columns requirments'''
        node_obj = {
            "id": "abc",
            "type": "IndicatorNode",
            "conf": self.conf,
            "inputs": {}
        }
        task = Task(node_obj)
        inN = IndicatorNode(task)
        out_cols = inN.columns_setup()

        col = "indicator"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in inN.required['stock_in'], msg)
        col = "high"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in inN.required['stock_in'], msg)
        col = "low"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in inN.required['stock_in'], msg)
        col = "close"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in inN.required['stock_in'], msg)
        col = "volume"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in inN.required['stock_in'], msg)

        col = "CH_OS_10_20"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in out_cols['stock_out'], msg)
        col = "BO_BA_b1_10"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in out_cols['stock_out'], msg)
        col = "BO_BA_b2_10"
        msg = "bad error: %s is missing" % (col)
        self.assertTrue(col in out_cols['stock_out'], msg)