Skip to content

Implement unit tests #16

@tomchadwin

Description

@tomchadwin

@mtravis So the way this works is that you should write tests in Python, give them a filename starting test_, and put them in test. There are already some there which are provided out of the box by the Plugin Builder. You can then either run those tests individually to check they pass, or use nose to run them all at once.

@akbargumbira (I think) wrote a post describing how to run such tests on Windows, but generally, they only run on Linux/Mac.

Here's an initial list of possible tests, to expand as we think of more:

  • xy_to_osgb gives a correct result
  • xy_to_osgb outside BNG coverage behaves gracefully
  • xy_to_osgb with different precision gives results with the correct precision
  • Changing precision spinner changes precision setting
  • Clicking with the tool writes to the clipboard

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions