Ejemplo n.º 1
0
 def test_snippet_prefix_equals_objectname(self, objectname_html_file):
     snippet = Function(objectname_html_file).to_snippet()
     assert snippet['prefix'] == 'ObjectName()'
Ejemplo n.º 2
0
 def test_snippet_body_of_barscalculated(self, barscalculated_html_file):
     snippet = Function(barscalculated_html_file).to_snippet()
     assert snippet['body'] == ["BarsCalculated(${1:int indicator_handle})$0"]
Ejemplo n.º 3
0
 def test_snippet_prefix_equals_barscalculated(self, barscalculated_html_file):
     snippet = Function(barscalculated_html_file).to_snippet()
     assert snippet['prefix'] == 'BarsCalculated()'
Ejemplo n.º 4
0
 def test_snippet_prefix_equals_chartsymbol(self, chartsymbol_html_file):
     snippet = Function(chartsymbol_html_file).to_snippet()
     assert snippet['prefix'] == 'ChartSymbol()'
Ejemplo n.º 5
0
 def test_function_name_equals_chartsymbol(self, chartsymbol_html_file):
     function = Function(chartsymbol_html_file)
     assert function.name == 'ChartSymbol'
Ejemplo n.º 6
0
 def test_function_parameters_item_3_of_objectname(self, objectname_html_file):
     function = Function(objectname_html_file)
     parameter = Parameter('type=-1', 'int')
     assert function.parameters[3] == parameter
Ejemplo n.º 7
0
 def test_function_parameters_item_0_of_objectname(self, objectname_html_file):
     function = Function(objectname_html_file)
     parameter = Parameter('chart_id', 'long')
     assert function.parameters[0] == parameter
Ejemplo n.º 8
0
 def test_snippet_description_of_chartsymbol(self, chartsymbol_html_file):
     snippet = Function(chartsymbol_html_file).to_snippet()
     assert snippet['description'] == "ChartSymbol() function"
Ejemplo n.º 9
0
 def test_function_parameters_len_equals_4(self, objectname_html_file):
     function = Function(objectname_html_file)
     assert len(function.parameters) == 4
Ejemplo n.º 10
0
 def test_function_parameters_item_0_of_barscalculated(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     parameter = Parameter('indicator_handle', 'int')
     assert function.parameters[0] == parameter
Ejemplo n.º 11
0
 def test_function_parameters_len_equals_1(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     assert len(function.parameters) == 1
Ejemplo n.º 12
0
 def test_function_type_equals_string(self, chartsymbol_html_file):
     function = Function(chartsymbol_html_file)
     assert function.type == 'string'
Ejemplo n.º 13
0
 def test_function_type_equals_int(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     assert function.type == 'int'
Ejemplo n.º 14
0
 def test_snippet_body_of_chartsymbol(self, chartsymbol_html_file):
     snippet = Function(chartsymbol_html_file).to_snippet()
     assert snippet['body'] == ["ChartSymbol(${1:long chart_id=0})$0"]
Ejemplo n.º 15
0
 def test_function_parameters_item_1_of_objectname(self, objectname_html_file):
     function = Function(objectname_html_file)
     parameter = Parameter('pos', 'int')
     assert function.parameters[1] == parameter
Ejemplo n.º 16
0
 def test_snippet_description_of_barscalculated(self, barscalculated_html_file):
     snippet = Function(barscalculated_html_file).to_snippet()
     assert snippet['description'] == "BarsCalculated() function"
Ejemplo n.º 17
0
 def test_function_parameters_item_2_of_objectname(self, objectname_html_file):
     function = Function(objectname_html_file)
     parameter = Parameter('sub_window=-1', 'int')
     assert function.parameters[2] == parameter
Ejemplo n.º 18
0
 def test_snippet_description_of_objectname(self, objectname_html_file):
     snippet = Function(objectname_html_file).to_snippet()
     assert snippet['description'] == "ObjectName() function"
Ejemplo n.º 19
0
 def test_function_name_equals_barscalculated(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     assert function.name == 'BarsCalculated'