def test_move_doc_to_shelf(self): doc = '2207 876234' test_shelf = '3' self.assertIn(doc, [document['number'] for document in documents]) with patch('app.input', side_effect=[doc, test_shelf]): app.move_doc_to_shelf() self.assertIn(doc, directories[test_shelf])
def test_move_doc_to_shelf(self): before_from = len(self.dirs['2']) before_to = len(self.dirs['3']) with patch('app.input', side_effect=['10006', '3']): app.move_doc_to_shelf() self.assertGreater(len(self.dirs['3']), before_to) self.assertLess(len(self.dirs['2']), before_from)
def test_move_doc_to_shelf(self): doc_num = '10006' for key, val in self.dirs.items(): if doc_num in val: old_shelf = key with patch('app.input', side_effect=[doc_num, '3']): app.move_doc_to_shelf() self.assertNotEqual(old_shelf, 3)
def test_move_doc_to_shelf(self): self.assertIn('11-2', app.directories['1']) self.assertNotIn('11-2', app.directories['2']) with patch('app.input', side_effect=['11-2', '2']): app.move_doc_to_shelf() self.assertNotIn('11-2', app.directories['1']) self.assertIn('11-2', app.directories['2'])
def test_move_doc_to_shelf(self): doc = '11-2' new_shelf = '3' old_shelf = '1' self.assertIn(doc, app.directories[old_shelf]) self.assertNotIn(doc, app.directories[new_shelf]) with patch('app.input', side_effect=[doc, new_shelf]), patch('app.print'): app.move_doc_to_shelf() self.assertNotIn(doc, app.directories[old_shelf]) self.assertIn(doc, app.directories[new_shelf])
def test_move_doc_to_shelf(self): doc_num = app.documents[len(app.documents) - 1].get('number') break_flag = False doc_shelf = None for shelf, docs_on_shelf in app.directories.items(): for document_num in docs_on_shelf: if doc_num == document_num: doc_shelf = shelf break_flag = True break if break_flag: break self.assertEqual(app.directories.get(doc_shelf).count(doc_num), 1) shelf_num = '999999' with patch('app.input', side_effect=[doc_num, shelf_num]): app.move_doc_to_shelf() self.assertEqual(app.directories.get(shelf_num)[0], doc_num) self.assertEqual(app.directories.get(doc_shelf).count(doc_num), 0)
def test_move_doc_to_shelf(self): user_input = ['11-2', '3'] with patch('app.input', side_effect=user_input): app.move_doc_to_shelf() self.assertIn('11-2', self.dirs['3'])
def test_move_doc_to_shelf(self, mock_input): mock_input.side_effect = [documents[1]['number'], '1'] app.move_doc_to_shelf() self.assertIn(documents[1]['number'], directories['1'])
def test_move_doc_to_shelf(self, input_mock): start_len_shelf_out = len(directories['1']) start_len_shelf_come = len(directories['3']) move_doc_to_shelf() self.assertGreater(start_len_shelf_out, len(directories['1'])) self.assertGreater(len(directories['3']), start_len_shelf_come)
def testing_move_doc_to_shelf(self): with patch('app.input', side_effect=['10006', '3']): app.move_doc_to_shelf() self.assertIn('10006', self.dirs['3']) self.assertNotIn('10006', self.dirs['2'])
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')
def test_move_doc_to_shelf(self): with patch('app.input', side_effect=['10006', '3']): app.move_doc_to_shelf() self.assertIn('515', app.directories.get('123', []))
def test_move(self, mock_input): app.move_doc_to_shelf() self.assertIn('11-2', directories['3'])
def test_move_doc_to_shelf(self): with patch('app.input', size_effect=['11-2', '3']): app.move_doc_to_shelf() self.test_delete()
def test_move_doc_to_shelf(self): before_len = len(app.directories['3']) with patch('app.input', side_effect=['10006', '3']): with Hider(): app.move_doc_to_shelf() self.assertGreater(len(app.directories['3']), before_len)