def test_hashtree_contain(self):
     element = CsvDataSetConfig(
         file_path='main.py',
         variable_names=['var1', 'var2'],
     )
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     assert '<hashTree />' in rendered_doc
Beispiel #2
0
 def test_stop_thread(self):
     element = CsvDataSetConfig(file_path=exist_file,
                                variable_names=['var1', 'var2'],
                                stop_thread=True)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     assert parsed_doc['result']['CSVDataSet']['boolProp'][3]['#text'] == 'true'
Beispiel #3
0
 def test_shared_mode(self):
     element = CsvDataSetConfig(file_path=exist_file,
                                variable_names=['var1', 'var2'],
                                share_mode=ShareMode.GROUP)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     assert parsed_doc['result']['CSVDataSet']['stringProp'][4]['#text'] == 'shareMode.group'
Beispiel #4
0
 def test_file_encoding(self):
     element = CsvDataSetConfig(file_path=exist_file,
                                variable_names=['var1', 'var2'],
                                file_encoding=FileEncoding.UTF16)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     assert parsed_doc['result']['CSVDataSet']['stringProp'][2]['#text'] == 'UTF-16'
Beispiel #5
0
 def test_delimiter(self):
     element = CsvDataSetConfig(file_path=exist_file,
                                variable_names=['var1', 'var2'],
                                delimiter='|')
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     assert parsed_doc['result']['CSVDataSet']['stringProp'][1]['#text'] == '|'
 def test_header_contain(self):
     element = CsvDataSetConfig(
         file_path='main.py',
         variable_names=['var1', 'var2'],
     )
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     is_contain = 'xml version' in rendered_doc
     assert is_contain is False
 def test_recycle(self):
     element = CsvDataSetConfig(file_path='main.py',
                                variable_names=['var1', 'var2'],
                                recycle=True)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     assert parsed_doc['result']['CSVDataSet']['boolProp'][2][
         '#text'] == 'true'
 def test_variable_names(self):
     element = CsvDataSetConfig(
         file_path='main.py',
         variable_names=['var1', 'var2', 'var3', 'var4'],
     )
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     assert parsed_doc['result']['CSVDataSet']['stringProp'][5][
         '#text'] == 'var1,var2,var3,var4'