Skip to content

Commit

Permalink
Merge pull request #957 from karldw/minor-test-bugs
Browse files Browse the repository at this point in the history
Fix bugs in tests
  • Loading branch information
ljwolf committed Jul 15, 2017
2 parents 3bc7771 + cbb989a commit 3b1ec25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pysal/cg/tests/test_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import pysal
import math
import unittest

import numpy as np
from pysal.common import (RTOL, ATOL)

class Sphere(unittest.TestCase):

Expand Down Expand Up @@ -70,7 +71,7 @@ def test_geogrid(self):
pup = (42.023768, -87.946389) # Arlington Heights IL
pdown = (41.644415, -87.524102) # Hammond, IN
grid1 = sphere.geogrid(pup, pdown, 3, lonx=False)
self.assertAlmostEqual(grid, grid1)
np.testing.assert_allclose(grid, grid1, rtol=RTOL, atol=ATOL)

def test_toXYZ(self):
w2 = {0: [2, 5, 6, 10], 1: [4, 7, 9, 14], 2: [6, 0, 3, 8],
Expand Down
7 changes: 4 additions & 3 deletions pysal/examples/test_examples.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import unittest
import pysal.examples as ex
import os


class Example_Tester(unittest.TestCase):
def test_get_path(self):
pathparts = ex.get_path('').split('/')
self.localpath = '/'.join(pathparts[-3:])
self.assertEquals(self.localpath, 'pysal/examples/')
pathparts = os.path.normpath(ex.get_path('')).split(os.path.sep)
self.localpath = os.path.join(*pathparts[-2:])
self.assertEquals(self.localpath, os.path.normpath('pysal/examples/'))

def test_parser(self):
for example in ex.available():
Expand Down

0 comments on commit 3b1ec25

Please sign in to comment.