Skip to content

Commit

Permalink
Fixed more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
runfalk committed Dec 22, 2015
1 parent 0bfa3b5 commit d918755
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spans/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,17 @@ def test_contains(self):
def test_startswith(self):
# Special case that discrete ranges can't cover
self.assertFalse(floatrange(1.0, lower_inc=False).startswith(1.0))
self.assertFalse(floatrange(1.0, lower_inc=False).startswith(
floatrange(1.0)))

def test_endswith(self):
# Special case that discrete ranges can't cover
self.assertFalse(floatrange(upper=5.0).endswith(5.0))
self.assertTrue(floatrange(upper=5.0, upper_inc=True).endswith(5.0))

self.assertFalse(floatrange(upper=5.0).endswith(
floatrange(upper=5.0, upper_inc=True)))

class TestDateRange(TestCase):
def test_datetime(self):
with self.assertRaises(TypeError):
Expand Down Expand Up @@ -373,10 +378,10 @@ def test_last(self):
self.assertEqual(strrange(u"a", u"c").last, u"b")
self.assertEqual(strrange(u"aa", u"cc").last, u"cb")

def text_prev(self):
def test_prev(self):
self.assertEqual(strrange.prev(u""), u"")
self.assertEqual(strrange.prev(u"b"), u"a")

def text_next(self):
def test_next(self):
self.assertEqual(strrange.next(u""), u"")
self.assertEqual(strrange.next(u"a"), u"b")

0 comments on commit d918755

Please sign in to comment.