示例#1
0
文件: test_lists.py 项目: Xion/taipan
 def test_keyword__of__absent(self):
     with self.assertNotFound():
         __unit__.findlast(of=None, in_=self.LIST)
示例#2
0
文件: test_lists.py 项目: Xion/taipan
 def test_positional__list__normal(self):
     for elem in self.LIST:
         self.assertEquals(elem, __unit__.findlast(elem, self.LIST))
示例#3
0
文件: test_lists.py 项目: Xion/taipan
 def test_keyword__only_list(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(in_=self.LIST)
示例#4
0
文件: test_lists.py 项目: Xion/taipan
 def test_positional__list__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(None, object())
示例#5
0
文件: test_lists.py 项目: Xion/taipan
 def test_positional__list__empty(self):
     with self.assertNotFound():
         __unit__.findlast(None, [])
     for elem in self.LIST:
         with self.assertNotFound():
             __unit__.findlast(elem, [])
示例#6
0
文件: test_lists.py 项目: Xion/taipan
 def test_keyword__where__present(self):
     self.assertEquals(
         self.LAST_EVEN, __unit__.findlast(where=self.EVEN, in_=self.LIST))
     self.assertEquals(
         self.LAST_ODD, __unit__.findlast(where=self.ODD, in_=self.LIST))
示例#7
0
 def test_positional__list__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(None, object())
示例#8
0
 def test_keyword__where__absent(self):
     with self.assertNotFound():
         __unit__.findlast(where=self.NEGATIVE, in_=self.LIST)
示例#9
0
 def test_keyword__where__present(self):
     self.assertEquals(self.LAST_EVEN,
                       __unit__.findlast(where=self.EVEN, in_=self.LIST))
     self.assertEquals(self.LAST_ODD,
                       __unit__.findlast(where=self.ODD, in_=self.LIST))
示例#10
0
 def test_keyword__of__absent(self):
     with self.assertNotFound():
         __unit__.findlast(of=None, in_=self.LIST)
示例#11
0
 def test_keyword__of__present(self):
     for elem in self.LIST:
         self.assertEquals(elem, __unit__.findlast(of=elem, in_=self.LIST))
示例#12
0
 def test_keyword__only_list(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(in_=self.LIST)
示例#13
0
 def test_positional__list__normal(self):
     for elem in self.LIST:
         self.assertEquals(elem, __unit__.findlast(elem, self.LIST))
示例#14
0
 def test_positional__list__empty(self):
     with self.assertNotFound():
         __unit__.findlast(None, [])
     for elem in self.LIST:
         with self.assertNotFound():
             __unit__.findlast(elem, [])
示例#15
0
文件: test_lists.py 项目: Xion/taipan
 def test_keyword__of__present(self):
     for elem in self.LIST:
         self.assertEquals(elem, __unit__.findlast(of=elem, in_=self.LIST))
示例#16
0
 def test_keyword__both(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(of=None, where=self.EVEN, in_=self.LIST)
示例#17
0
文件: test_lists.py 项目: Xion/taipan
 def test_keyword__where__absent(self):
     with self.assertNotFound():
         __unit__.findlast(where=self.NEGATIVE, in_=self.LIST)
示例#18
0
文件: test_lists.py 项目: Xion/taipan
 def test_positional__list__none(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(None, None)
示例#19
0
文件: test_lists.py 项目: Xion/taipan
 def test_keyword__both(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(of=None, where=self.EVEN, in_=self.LIST)
示例#20
0
 def test_positional__list__none(self):
     with self.assertRaises(TypeError):
         __unit__.findlast(None, None)