Skip to content

Commit

Permalink
First unit test attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchadwin committed Jan 15, 2018
1 parent 82e098e commit ff9ed47
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/test_gridref.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
"""Tests XY to OSGB functionality.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = '[email protected]'
__date__ = '15/01/2018'
__copyright__ = ('Copyright 2018, Tom Chadwin')

import os
import unittest

from utilities import get_qgis_app

from xy_to_osgb import xy_to_osgb
QGIS_APP = get_qgis_app()


class QGISTest(unittest.TestCase):
"""Test the QGIS Environment"""

def test_xy_to_osgb(self):
"""Given XY returns correct OSGB coordinates"""

osgb_gridref = xy_to_osgb(393618.933445, 564351.935939)
expected = "NY9364"
self.assertEqual(osgb_gridref, expected)

if __name__ == '__main__':
unittest.main()

0 comments on commit ff9ed47

Please sign in to comment.