Skip to content

[Python] Tests not working #6192

Open
Open
@sverhagen

Description

@sverhagen
Description

Generating API clients in a number of languages, Java and Python so far. The Java one is all solid, unit tests running successfully. For the Python one I'm not able to make tests succeed.

I'm getting a lot of errors, such as:

ERROR: Delete the current test run and then create a new test run based on the latest test case version.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
TypeError: make_test_run_current_with_http_info() missing 1 required positional argument: 'id'

Or:

ERROR: Search for test runs associated with test cases, test plans, an test cycles
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)

See errors.txt for the full output.

Swagger-codegen version
io.swagger:swagger-codegen-maven-plugin:2.2.3
Swagger declaration file content or url

api-docs

Command line used for generation
mvn install
<executions>
    <execution>
        <id>generate-python</id>
        <goals>
            <goal>generate</goal>
        </goals>
        <configuration>
            <configOptions>
                <packageName>jama_rest_client</packageName>
                <projectName>jama-rest-client</projectName>
                <packageVersion>${project.version}</packageVersion>
                <packageUrl>https://www.jamaclient.com</packageUrl>
            </configOptions>
            <addCompileSourceRoot>false</addCompileSourceRoot>
            <inputSpec>${swagger-json.dir}/api-docs</inputSpec>
            <language>python</language>
            <output>target/api-client-python</output>
            <skipOverwrite>false</skipOverwrite>
        </configuration>
    </execution>
</executions>
Steps to reproduce
  1. Run Codegen: mvn install

  2. Traverse to the output folder: cd target/api-client-python

  3. Create a virtual environment:

     virtualenv api-client-python
     pip install -r requirements.txt -r test-requirements.txt
    
  4. Run the tests:

     nosetests tests/*
    

By the way, I'm running this in a Docker container, for optimal isolation, but I won't bother you with those steps (yet), since it seems (so far) unrelated.

Related issues/PRs

None found.

Suggest a fix/enhancement

N/A yet.


Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions