You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
710 B
27 lines
710 B
#coding:utf-8
|
|
|
|
import unittest
|
|
import sys
|
|
sys.path.append('../src')
|
|
from position import Position
|
|
|
|
class PositionUTest(unittest.TestCase):
|
|
def test_is_norther_than(self):
|
|
center = Position(0, 0)
|
|
north = Position(90, 0)
|
|
south = Position(-90, 0)
|
|
self.assertTrue(north.is_norther_than(south))
|
|
self.assertFalse(south.is_norther_than(north))
|
|
def test___eq__(self):
|
|
north = Position(90, 0)
|
|
south = Position(-90, 0)
|
|
self.assertTrue(north.__eq__(north))
|
|
self.assertFalse(north.__eq__(south))
|
|
self.assertFalse(north.__eq__(None))
|
|
self.assertFalse(north.__eq__(12))
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|