Exemple #1
0
 def test_snippet_prefix_equals_objectname(self, objectname_html_file):
     snippet = Function(objectname_html_file).to_snippet()
     assert snippet['prefix'] == 'ObjectName()'
Exemple #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"]
Exemple #3
0
 def test_snippet_prefix_equals_barscalculated(self, barscalculated_html_file):
     snippet = Function(barscalculated_html_file).to_snippet()
     assert snippet['prefix'] == 'BarsCalculated()'
Exemple #4
0
 def test_snippet_prefix_equals_chartsymbol(self, chartsymbol_html_file):
     snippet = Function(chartsymbol_html_file).to_snippet()
     assert snippet['prefix'] == 'ChartSymbol()'
Exemple #5
0
 def test_function_name_equals_chartsymbol(self, chartsymbol_html_file):
     function = Function(chartsymbol_html_file)
     assert function.name == 'ChartSymbol'
Exemple #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
Exemple #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
Exemple #8
0
 def test_snippet_description_of_chartsymbol(self, chartsymbol_html_file):
     snippet = Function(chartsymbol_html_file).to_snippet()
     assert snippet['description'] == "ChartSymbol() function"
Exemple #9
0
 def test_function_parameters_len_equals_4(self, objectname_html_file):
     function = Function(objectname_html_file)
     assert len(function.parameters) == 4
Exemple #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
Exemple #11
0
 def test_function_parameters_len_equals_1(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     assert len(function.parameters) == 1
Exemple #12
0
 def test_function_type_equals_string(self, chartsymbol_html_file):
     function = Function(chartsymbol_html_file)
     assert function.type == 'string'
Exemple #13
0
 def test_function_type_equals_int(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     assert function.type == 'int'
Exemple #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"]
Exemple #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
Exemple #16
0
 def test_snippet_description_of_barscalculated(self, barscalculated_html_file):
     snippet = Function(barscalculated_html_file).to_snippet()
     assert snippet['description'] == "BarsCalculated() function"
Exemple #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
Exemple #18
0
 def test_snippet_description_of_objectname(self, objectname_html_file):
     snippet = Function(objectname_html_file).to_snippet()
     assert snippet['description'] == "ObjectName() function"
Exemple #19
0
 def test_function_name_equals_barscalculated(self, barscalculated_html_file):
     function = Function(barscalculated_html_file)
     assert function.name == 'BarsCalculated'