Пример #1
0
 def test_keyword__of__absent(self):
     self.assertEquals(-1, __unit__.lastindex(of=None, in_=self.LIST))
Пример #2
0
 def test_positional__list__normal(self):
     for elem in self.LIST:
         self.assertEquals(
             self.LAST_INDICES[elem], __unit__.lastindex(elem, self.LIST))
Пример #3
0
 def test_keyword__only_list(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(in_=self.LIST)
Пример #4
0
 def test_positional__list__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(None, object())
Пример #5
0
 def test_positional__list__empty(self):
     self.assertEquals(-1, __unit__.lastindex(None, []))
     for elem in self.LIST:
         self.assertEquals(-1, __unit__.lastindex(elem, []))
Пример #6
0
 def test_keyword__where__present(self):
     self.assertEquals(self.EVEN_LAST_INDEX,
                       __unit__.lastindex(where=self.EVEN, in_=self.LIST))
     self.assertEquals(self.ODD_LAST_INDEX,
                       __unit__.lastindex(where=self.ODD, in_=self.LIST))
Пример #7
0
 def test_positional__list__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(None, object())
Пример #8
0
 def test_keyword__where__absent(self):
     self.assertEquals(
         -1, __unit__.lastindex(where=self.NEGATIVE, in_=self.LIST))
Пример #9
0
 def test_keyword__where__present(self):
     self.assertEquals(self.EVEN_LAST_INDEX,
                       __unit__.lastindex(where=self.EVEN, in_=self.LIST))
     self.assertEquals(self.ODD_LAST_INDEX,
                       __unit__.lastindex(where=self.ODD, in_=self.LIST))
Пример #10
0
 def test_keyword__of__absent(self):
     self.assertEquals(-1, __unit__.lastindex(of=None, in_=self.LIST))
Пример #11
0
 def test_keyword__of__present(self):
     for elem in self.LIST:
         self.assertEquals(self.LAST_INDICES[elem],
                           __unit__.lastindex(of=elem, in_=self.LIST))
Пример #12
0
 def test_keyword__only_list(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(in_=self.LIST)
Пример #13
0
 def test_positional__list__normal(self):
     for elem in self.LIST:
         self.assertEquals(self.LAST_INDICES[elem],
                           __unit__.lastindex(elem, self.LIST))
Пример #14
0
 def test_positional__list__empty(self):
     self.assertEquals(-1, __unit__.lastindex(None, []))
     for elem in self.LIST:
         self.assertEquals(-1, __unit__.lastindex(elem, []))
Пример #15
0
 def test_keyword__of__present(self):
     for elem in self.LIST:
         self.assertEquals(self.LAST_INDICES[elem],
                           __unit__.lastindex(of=elem, in_=self.LIST))
Пример #16
0
 def test_keyword__both(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(of=None, where=self.EVEN, in_=self.LIST)
Пример #17
0
 def test_keyword__where__absent(self):
     self.assertEquals(
         -1, __unit__.lastindex(where=self.NEGATIVE, in_=self.LIST))
Пример #18
0
 def test_positional__list__none(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(None, None)
Пример #19
0
 def test_keyword__both(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(of=None, where=self.EVEN, in_=self.LIST)
Пример #20
0
 def test_positional__list__none(self):
     with self.assertRaises(TypeError):
         __unit__.lastindex(None, None)