def test_delete_doc(self): self.assertTrue(app.check_document_existance("11-2")) # check before deleting doc with patch('app.input', return_value="11-2") as child1: app.delete_doc() self.assertFalse(app.check_document_existance("11-2")) # check after deleting doc
def test_delete_doc(self): self.assertTrue(app.check_document_existance("11-2")) with patch('app.input', return_value="11-2"): app.delete_doc() self.assertFalse(app.check_document_existance("11-2"))
def test_show_all_docs_info(self): # L new_doc_number = '2207 876234' new_doc_number2 = '11-2' new_doc_number3 = '10006' self.assertEqual(check_document_existance(new_doc_number), True) self.assertEqual(check_document_existance(new_doc_number2), True) self.assertEqual(check_document_existance(new_doc_number3), True)
def test_delete_doc(self): # создадим, чтобы было что удалять new_doc = {"type": 'INN', "number": '123', "name": 'Ivan Petrov'} new_doc_number = '123' new_doc_shelf_number = '10' documents.append(new_doc) append_doc_to_shelf(new_doc_number, new_doc_shelf_number) # проверяем, что оно создалось self.assertEqual(check_document_existance(new_doc_number), True) # удаляем, что только что создали и проверяем, что оно удалилось print('Для теста скопируйте значение номера: 123') self.assertEqual(delete_doc(), (new_doc_number, True))
def test_get_doc_owner_name(self): self.assertTrue(app.check_document_existance(documents[1]['number'])) with patch('app.input', return_value=documents[1]['number']): self.assertEqual(app.get_doc_owner_name(), documents[1]['name'])
def test_check_value(self): self.assertTrue(app.check_document_existance('10006')) self.assertFalse(app.check_document_existance('0a0a0a0a'))
def test_check_document_existance(self): doc_founded = app.check_document_existance('10006') self.assertTrue(doc_founded)
def test_check_document_existance(self): user_doc_number = '2207 876234' app.check_document_existance(user_doc_number=user_doc_number) self.assertTrue(user_doc_number)
def test_check_document_existance_failed(self): self.assertFalse(check_document_existance('-'))
def test_check_doc_existance(self): self.assertTrue(app.check_document_existance('10006'))
def test_check_document_existance(self): assert check_document_existance('11-2') == True
def test_check_document_existance(self): with patch("app.input", return_value="11-2"): doc_founded = app.check_document_existance(self.documents) self.assertTrue(doc_founded)
def test_check_document_existance(self, mock_doc_number): mock_doc_number.return_value = True document = '11-2' result = check_document_existance(document) self.assertEqual(result, True)
def test_delete_doc(self): doc_number = '10006' with patch('app.input', return_value=doc_number): app.delete_doc() self.assertFalse(app.check_document_existance(doc_number))
def test_check_document_existance(self): self.assertIn('10006', [doc['number'] for doc in app.documents]) result = app.check_document_existance('10006') self.assertTrue(result)
def test_negative_check_document_existance(self): self.assertNotIn('555', [doc['number'] for doc in app.documents]) result = app.check_document_existance('555') self.assertFalse(result)
def test_is_doc_exists(self): doc_number = app.check_document_existance('11-2') self.assertTrue(doc_number)
def test_is_doc_not_exists(self): doc_number = app.check_document_existance('112') self.assertFalse(doc_number)
def test_check_document_existance(self): exist = app.check_document_existance('2207 876234') self.assertTrue(exist) exist = app.check_document_existance('2207876234') self.assertFalse(exist)
def test_delete_doc(self): del_doc_number = documents[1]['number'] self.assertTrue(app.check_document_existance(del_doc_number)) with patch('app.input', return_value=del_doc_number): app.delete_doc() self.assertFalse(app.check_document_existance(del_doc_number))
def testing_check_document_existance(self): presence = app.check_document_existance('2207 876234') self.assertTrue(presence) presence = app.check_document_existance('2207876234') self.assertFalse(presence)
def test_check_documents_existance(self): self.assertTrue(app.check_document_existance('11-2'))
def test_check_document_existance(self): self.assertTrue(app.check_document_existance('11-2')) self.assertFalse(app.check_document_existance('not exs'))
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_check_document_existance(self): """Проверка наличия валидного документа, и отсутствия невалидного""" self.assertEqual(app.check_document_existance('11-2'), True) self.assertNotEqual(app.check_document_existance('левый документ, которого нет'), True)
def test_check_document_existance(self): self.assertTrue(app.check_document_existance('2207 876234')) self.assertFalse(app.check_document_existance('88005553535'))
def test_check_document_existance(self): check_false = app.check_document_existance('999999999999999999') check_true = app.check_document_existance( app.documents[0].get('number')) self.assertFalse(check_false) self.assertTrue(check_true)
def test_check_document_existance_success(self): self.assertTrue(check_document_existance('2207 876234'))