def test_hashtree_contain(self):
     element = RandomCsvDataSetConfig(
         filename=file,
         variable_names=['var1', 'var2'],
     )
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     assert '<hashTree />' in rendered_doc
 def test_header_contain(self):
     element = RandomCsvDataSetConfig(
         filename=file,
         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_independent_per_thread(self):
     element = RandomCsvDataSetConfig(filename=file,
                                      variable_names=['var1', 'var2'],
                                      independent_per_thread=True)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     for tag in parsed_doc['result'][
             'com.blazemeter.jmeter.RandomCSVDataSetConfig']['boolProp']:
         if tag['@name'] == 'independentListPerThread':
             assert tag['#text'] == 'true'
 def test_random_order(self):
     element = RandomCsvDataSetConfig(filename=file,
                                      variable_names=['var1', 'var2'],
                                      random_order=False)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     for tag in parsed_doc['result'][
             'com.blazemeter.jmeter.RandomCSVDataSetConfig']['boolProp']:
         if tag['@name'] == 'randomOrder':
             assert tag['#text'] == 'false'
 def test_ignore_first_line(self):
     element = RandomCsvDataSetConfig(filename=file,
                                      variable_names=['var1', 'var2'],
                                      ignore_first_line=True)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     for tag in parsed_doc['result'][
             'com.blazemeter.jmeter.RandomCSVDataSetConfig']['boolProp']:
         if tag['@name'] == 'ignoreFirstLine':
             assert tag['#text'] == 'true'
 def test_file_encoding(self):
     element = RandomCsvDataSetConfig(filename=file,
                                      variable_names=['var1', 'var2'],
                                      file_encoding=FileEncoding.UTF16)
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     for tag in parsed_doc['result'][
             'com.blazemeter.jmeter.RandomCSVDataSetConfig']['stringProp']:
         if tag['@name'] == 'fileEncoding':
             assert tag['#text'] == 'UTF-16'
 def test_delimiter(self):
     element = RandomCsvDataSetConfig(filename=file,
                                      variable_names=['var1', 'var2'],
                                      delimiter='|')
     rendered_doc = tag_wrapper(element.to_xml(), 'result')
     parsed_doc = xmltodict.parse(rendered_doc)
     for tag in parsed_doc['result'][
             'com.blazemeter.jmeter.RandomCSVDataSetConfig']['stringProp']:
         if tag['@name'] == 'delimiter':
             assert tag['#text'] == '|'