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