Skip to content

Change lib interface #61

Description

@feffe

I would like to change the interface of this lib. I can present a first step in a pr.

I find it weird that to_xml_string and to_file are static methods for TestSuite. Their input is a list of TestSuite objects so they don't act on a TestSuite object. I would like to move them out of the TestSuite class to separate functions that act on a list of TestSuite objects. An alternative would be to introduce a new class called TestSuites that can be instantiated with a list of TestSuite objects.

I actually would like to remove the to_file method entirely. It just writes the xml string to an open file. I don't see why that would be the responsibility of this lib.

I think build_xml_doc should not be exposed outside of the lib. TestCase and TestSuite should just be simple holders of data and we can turn a list of TestSuite objects to a xml string. But I can present a suggestion for that in a later pr. I have only found one repo on github that uses build_xml_doc (https://github.com/CyberGRX/questions-three).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions