Esempio n. 1
0
 def test_Find_4(self):
     _user_input = [
         6,
         '10',
         '11 : 10',
         '12 : 11',
         '20',
         '13 : 11 20',
         '21 : 20',
         6,
         '20',
         '13',
         '10',
         '11',
         '21',
         '12',
     ]
     _Expected = [
         '13',
         '11',
         '21',
         '12',
     ]
     _extra = {}
     with patch('builtins.input', side_effect=_user_input):
         _extra = Exceptions.Find()
     _Actual = Exceptions.RefineExtra(_extra)
     self.assertListEqual(_Actual, _Expected)
Esempio n. 2
0
 def test_Find_5(self):
     _user_input = [
         4, "winter", "is", "coming", "OMG : winter is coming", 4, "winter",
         "is", "coming", "OMG"
     ]
     _Expected = ['OMG']
     _extra = {}
     with patch('builtins.input', side_effect=_user_input):
         _extra = Exceptions.Find()
     _Actual = Exceptions.RefineExtra(_extra)
     self.assertListEqual(_Actual, _Expected)
Esempio n. 3
0
 def test_Find_3(self):
     _user_input = [
         4, 'base', 'second : base', 'otherbase', 'first : otherbase', 4,
         'base', 'otherbase', 'first', 'second'
     ]
     _Expected = ['first', 'second']
     _extra = {}
     with patch('builtins.input', side_effect=_user_input):
         _extra = Exceptions.Find()
     _Actual = Exceptions.RefineExtra(_extra)
     self.assertListEqual(_Actual, _Expected)
Esempio n. 4
0
 def test_Find_8(self):
     _user_input = [
         14, 'a', 'b : a', 'c : a', 'f : a', 'd : c b', 'g : d f', 'i : g',
         'm : i', 'n : i', 'z : i', 'e : m n', 'y : z', 'x : z',
         'w : e y x', 9, 'y', 'm', 'n', 'm', 'd', 'e', 'g', 'a', 'f'
     ]
     _Expected = ['m', 'e', 'g', 'f']
     _extra = {}
     with patch('builtins.input', side_effect=_user_input):
         _extra = Exceptions.Find()
     _Actual = Exceptions.RefineExtra(_extra)
     self.assertListEqual(_Actual, _Expected)
Esempio n. 5
0
 def test_Find_6(self):
     _user_input = [
         4, "BaseException", "Exception : BaseException",
         "LookupError : Exception", "KeyError : LookupError", 2,
         "BaseException", "KeyError"
     ]
     _Expected = ['KeyError']
     _extra = {}
     with patch('builtins.input', side_effect=_user_input):
         _extra = Exceptions.Find()
     _Actual = Exceptions.RefineExtra(_extra)
     self.assertListEqual(_Actual, _Expected)
Esempio n. 6
0
 def test_Find_1(self):
     _user_input = [
         4, 'ArithmeticError', 'ZeroDivisionError : ArithmeticError',
         'OSError', 'FileNotFoundError : OSError', 4, 'ZeroDivisionError',
         'OSError', 'ArithmeticError', 'FileNotFoundError'
     ]
     _Expected = ['FileNotFoundError']
     _extra = {}
     with patch('builtins.input', side_effect=_user_input):
         _extra = Exceptions.Find()
     _Actual = Exceptions.RefineExtra(_extra)
     self.assertListEqual(_Actual, _Expected)