Esempio n. 1
0
 def test_add_multiple_args(self):
     function_info = ('func', 'dummy_space', 123, 4)
     function = nodes.Function(*function_info)
     function.add_arg(['arg_0', 'arg_1'])
     assert ['arg_0', 'arg_1'] == function.args_list
Esempio n. 2
0
 def test_add_arg(self):
     function_info = ('func', 'dummy_space', 123, 4)
     function = nodes.Function(*function_info)
     function.add_arg('arg')
     assert ['arg'] == function.args_list
Esempio n. 3
0
 def test_dtype(self):
     function_info = ('func', 'dummy_space', 123, 4, 'float')
     function = nodes.Function(*function_info)
     assert (function.name, function.scope, function.lineno,
             function.col_offset, function.dtype) == function_info
Esempio n. 4
0
 def test_default_function(self):
     function_info = ('func', 'dummy_space', 123, 4)
     expected_info = (*function_info, '')
     function = nodes.Function(*function_info)
     assert (function.name, function.scope, function.lineno,
             function.col_offset, function.dtype) == expected_info
Esempio n. 5
0
 def test_equality(self):
     function_info = ('func', 'dummy_space', 123, 4)
     function_01 = nodes.Function(*function_info)
     function_02 = nodes.Function(*function_info)
     assert function_01 == function_02
Esempio n. 6
0
 def test_prepend_arg(self):
     function_info = ('func', 'dummy_space', 123, 4)
     function = nodes.Function(*function_info)
     function.add_arg(['arg_0', 'arg_1'])
     function.prepend_arg('arg_2')
     assert ['arg_2', 'arg_0', 'arg_1'] == function.args_list