Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_create_xml_testcase():
"""Check if create_xml_testcase creates the expected XML tag."""
testcase = mock.MagicMock()
testcase.name = 'test_it_works'
testcase.parent_class = 'FeatureTestCase'
testcase.testmodule = 'tests/test_feature.py'
testcase.docstring = 'Test feature docstring'
testcase.fields = {
field: field for field in
default_config.TESTCASE_FIELDS + default_config.TESTCASE_CUSTOM_FIELDS
}
testcase.fields['parametrized'] = 'yes'
config = BetelgeuseConfig()
generated = ElementTree.tostring(
create_xml_testcase(config, testcase, '{path}#{line_number}'),
encoding='unicode'
)
assert generated == (
'