Ejemplo n.º 1
0
class FlowActionOutputTest(unittest.TestCase):
    Type = "FlowActionOutput"
    Output = "ANY"

    def setUp(self):
        self.target = FlowActionOutput(self.Type, self.Output)

    def tearDown(self):
        self.target = None

    def test_constructor(self):
        self.assertEqual(self.target._body[self.target.TYPE], self.Type)
        self.assertEqual(self.target._body[self.target.OUTPUT], self.Output)

    def test_output(self):
        self.assertEqual(self.target.output, self.Output)

    def test_create_from_packed(self):
        self.value = {"type": self.Type,
                      "output": "Output01"}
        self.result = self.target.create_from_packed(self.value)
        self.assertEqual(self.result._body[self.target.TYPE],
                         "FlowActionOutput")
        self.assertEqual(self.result._body[self.target.OUTPUT], "Output01")

    def test_packed_object(self):
        self.result = self.target.packed_object()
        self.assertEqual(self.result[self.target.TYPE], self.Type)
        self.assertEqual(self.result[self.target.OUTPUT], self.Output)
Ejemplo n.º 2
0
 def setUp(self):
     self.target = FlowActionOutput(self.Type, self.Output)