示例#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)
示例#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)
示例#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)
示例#4
0
 def test_init_with_device(self):
     step = Step(app='HelloWorld', action='helloWorld', device='dev')
     self.__compare_init(step, '', '', 'helloWorld', 'HelloWorld', 'dev',
                         {}, [], [], ['', ''], [])
示例#5
0
 def test_init_with_name(self):
     step = Step(app='HelloWorld', action='helloWorld', name='name')
     self.__compare_init(step, 'name', '', 'helloWorld', 'HelloWorld', '',
                         {}, [], [], ['', 'name'], [])
示例#6
0
 def test_init_with_invalid_input_type(self):
     with self.assertRaises(InvalidInput):
         Step(app='HelloWorld',
              action='returnPlusOne',
              inputs={'number': 'invalid'})
示例#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}, [], [], ['', ''], [])