示例#1
0
    def test_get_doc_shelf(self):
        with patch('app.input') as in_mock:
            in_mock.return_value = '11-2'
            shelf_number = app.get_doc_shelf()
            self.assertEqual(shelf_number, '1')

            in_mock.return_value = '10006'
            shelf_number = app.get_doc_shelf()
            self.assertNotEqual(shelf_number, '1')
示例#2
0
    def test_get_doc_shelf(self):
        user_input = ['10006']
        with patch('app.input', side_effect=user_input):
            directory_number = app.get_doc_shelf()

        self.assertEqual(directory_number, '2')

        user_input = ['11111']
        with patch('app.input', side_effect=user_input):
            directory_number = app.get_doc_shelf()

        self.assertFalse(directory_number)
示例#3
0
 def testing_get_doc_shelf(self):
     correct_number = '2'
     with patch('app.input', return_value=f'{self.dirs["2"][0]}'):
         shelf_to_check = app.get_doc_shelf()
     self.assertIs(correct_number, shelf_to_check)
示例#4
0
 def test_get_doc_shelf(self, mock_doc_number):
     mock_doc_number.return_value = '10006'
     result = get_doc_shelf()
     self.assertEqual('2', result)
示例#5
0
 def test_get_doc_shelf(self):
     with patch('app.input', return_value='10006'):
         self.assertIs(app.get_doc_shelf(), '2')
示例#6
0
 def test_document_add(self):
     self.assertEqual(add_new_doc(), 'test')
     self.assertEqual(get_doc_shelf(), 'test')
示例#7
0
    def test_get_doc_shelf(self):
        with patch('app.input', return_value='not exs'):
            self.assertIsNone(app.get_doc_shelf())

        with patch('app.input', return_value='11-2'):
            self.assertEqual(app.get_doc_shelf(), '1')
示例#8
0
 def test_get_doc_shelf(self, mock_input):
     result = get_doc_shelf()
     assert result == '2'
 def test_get_value(self):
     self.assertMultiLineEqual(app.get_doc_owner_name(), 'Аристарх Павлов')
     self.assertEqual(app.get_doc_shelf(), '2')
 def test_get_doc_shelf(self, mock_input):
     for shelf, doc_list in app.directories.items():
         if AppTester.test_doc_number in doc_list:
             self.assertEqual(app.get_doc_shelf(), shelf)
             break
示例#11
0
 def test_get_doc_shelf(self):
     right_number = '2'
     with patch('app.input', return_value=f'{self.dirs["2"][0]}'):
         check = app.get_doc_shelf()
     self.assertIs(right_number, check)
示例#12
0
 def test_get_doc_shelf(self):
     self.assertTrue(app.check_document_existance("10006"))
     with patch('app.input', return_value="10006"):
         self.assertEqual(app.get_doc_shelf(), '2')
 def test_get_doc_shelf(self):
     doc_number = documents[0]['number']
     with patch('app.input', return_value=doc_number):
         self.assertEqual(app.get_doc_shelf(), '1')
示例#14
0
 def test_get_doc_shelf(self):
     doc_number = '10006'
     with patch('app.input', return_value=doc_number):
         result = app.get_doc_shelf()
     self.assertIn(result, app.directories.keys())
示例#15
0
 def test_get_doc_shelf(self, doc_num, etalon_result):
     result = app.get_doc_shelf(doc_num)
     assert result == etalon_result
示例#16
0
 def test_get_doc_shelf(self, input_mock):
     directori_number = get_doc_shelf()
     real_number = '1'
     self.assertEqual(directori_number, real_number)
示例#17
0
 def test_get_doc_shelf_good(self):
     self.assertEqual(app.get_doc_shelf(), '1')
示例#18
0
 def test_get_doc_shelf(self):
     with patch('app.input', return_value='2207 876234') as _:
         self.assertEqual(app.get_doc_shelf(), '1')
示例#19
0
 def test_get_doc_shelf_bad(self):
     self.assertEqual(app.get_doc_shelf(), None)
示例#20
0
文件: tests.py 项目: Nichi13/homework
 def test_4(self, input):
     with mock.patch('app.directories', self.directories):
         resalt = get_doc_shelf()
     self.assertEqual('2', resalt)
示例#21
0
 def test_move_doc_to_shelf(self):
     with patch('app.input', side_effect=['10006', '2']):
         app.move_doc_to_shelf()
     with patch('app.input', return_value='10006'):
         dir = app.get_doc_shelf()
         self.assertEqual(dir, '2')
示例#22
0
 def test_get_doc_shelf(self):
     with patch('app.input', return_value='2207 876234'):
         shelf_number = app.get_doc_shelf()
         self.assertEqual(shelf_number, '1')
示例#23
0
 def test_get_doc_shelf(self):
     self.assertTrue(app.get_doc_shelf())
示例#24
0
 def test_get_doc_shelf(self):
     with patch('app.input',
                return_value=app.documents[len(app.documents) -
                                           1].get('number')):
         shelf_num = app.get_doc_shelf()
     self.assertIsInstance(shelf_num, str)
示例#25
0
    def test_get_doc_shelf(self):

        with patch('app.input', return_value='11-2'):
            self.assertEqual('1', app.get_doc_shelf())