Exemplo n.º 1
0
 def test_as_json_with_children_with_name(self):
     step = Step(app='HelloWorld', action='helloWorld', name='name')
     self.basic_json['name'] = 'name'
     self.assertDictEqual(step.as_json(with_children=True), self.basic_json)
Exemplo n.º 2
0
 def test_as_json_without_children_with_device(self):
     step = Step(app='HelloWorld', action='helloWorld', device='device')
     self.basic_json['device'] = 'device'
     self.assertDictEqual(step.as_json(with_children=False),
                          self.basic_json)
Exemplo n.º 3
0
 def test_init_with_widgets(self):
     widgets = [('aaa', 'bbb'), ('ccc', 'ddd'), ('eee', 'fff')]
     step = Step(app='HelloWorld', action='helloWorld', widgets=widgets)
     self.__compare_init(step, '', '', 'helloWorld', 'HelloWorld', '', {},
                         [], [], ['', ''], widgets)
Exemplo n.º 4
0
 def test_init_with_device(self):
     step = Step(app='HelloWorld', action='helloWorld', device='dev')
     self.__compare_init(step, '', '', 'helloWorld', 'HelloWorld', 'dev',
                         {}, [], [], ['', ''], [])
Exemplo n.º 5
0
 def test_init_with_name(self):
     step = Step(app='HelloWorld', action='helloWorld', name='name')
     self.__compare_init(step, 'name', '', 'helloWorld', 'HelloWorld', '',
                         {}, [], [], ['', 'name'], [])
Exemplo n.º 6
0
 def test_init_with_invalid_input_type(self):
     with self.assertRaises(InvalidInput):
         Step(app='HelloWorld',
              action='returnPlusOne',
              inputs={'number': 'invalid'})
Exemplo n.º 7
0
 def test_init_with_inputs_with_conversion(self):
     step = Step(app='HelloWorld',
                 action='returnPlusOne',
                 inputs={'number': '-5.6'})
     self.__compare_init(step, '', '', 'returnPlusOne', 'HelloWorld', '',
                         {'number': -5.6}, [], [], ['', ''], [])