Example #1
0
 def test_normal(self):
     self.assertEquals(self.LAST, __unit__.last(self.NORMAL_LIST))
Example #2
0
 def test_class__deep_hierarchy(self):
     chain = self._create_inheritance_chain(8)
     superclasses, class_ = init(chain), last(chain)
     self.assertItemsEqual(
         [object] + superclasses, __unit__.iter_superclasses(class_))
Example #3
0
 def test_empty(self):
     with self.assertRaises(IndexError):
         __unit__.last([])
Example #4
0
 def test_singleton(self):
     self.assertEquals(self.LAST, __unit__.last(self.SINGLETON_LIST))
Example #5
0
 def test_none(self):
     with self.assertRaises(TypeError):
         __unit__.last(None)
Example #6
0
 def test_some_object(self):
     with self.assertRaises(TypeError):
         __unit__.last(object())
Example #7
0
 def test_normal(self):
     self.assertEquals(self.LAST, __unit__.last(self.NORMAL_LIST))
Example #8
0
 def test_singleton(self):
     self.assertEquals(self.LAST, __unit__.last(self.SINGLETON_LIST))
Example #9
0
 def test_empty(self):
     with self.assertRaises(IndexError):
         __unit__.last([])
Example #10
0
 def test_some_object(self):
     with self.assertRaises(TypeError):
         __unit__.last(object())
Example #11
0
 def test_none(self):
     with self.assertRaises(TypeError):
         __unit__.last(None)