Guest User

Untitled

a guest
Nov 21st, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. Testing started at 10:45 AM ...
  2. C:\Users\PStoiko\PycharmProjects\python_training_2\env\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\pycharm\_jb_pytest_runner.py" --path C:/Users/PStoiko/PycharmProjects/python_training_2/test/test_add_contact.py
  3. Launching pytest with arguments C:/Users/PStoiko/PycharmProjects/python_training_2/test/test_add_contact.py in C:\Users\PStoiko\PycharmProjects\python_training_2\test
  4.  
  5. ============================= test session starts =============================
  6. platform win32 -- Python 3.7.1, pytest-3.10.0, py-1.7.0, pluggy-0.8.0
  7. rootdir: C:\Users\PStoiko\PycharmProjects\python_training_2\test, inifile:collected 1 item
  8.  
  9. test_add_contact.py F
  10. test_add_contact.py:5 (test_add_contact)
  11. [67:stop Pierr...mesecond, ...] != [67:stop Pier...mesecond, ...]
  12.  
  13. Expected :[67:stop Pier...mesecond, ...]
  14. Actual :[67:stop Pierr...mesecond, ...]
  15. <Click to see difference>
  16.  
  17. app = <fixture.application.Application object at 0x034D1530>
  18.  
  19. def test_add_contact(app):
  20. old_contacts = app.contact.get_contact_list()
  21. contact = Contact(first_name="Pierre", middlename="sto", lastname="stop", nickname="nik", title="title", company_name="Company", address="3096- rue goyer", home_phone="514", mobile_phone="515",
  22. work_phone="516", fax="517", email="1@sto.com", second_email="2@sto.com", third_email="3@sto.com", homepage="sto.com", birthdate="18", birthmonth="January", birth_year="1971",
  23. anniversary_day="18", anniversary_month="February", anniversary_year="2018", second_address="address second", second_home="home second", notes="notes")
  24. app.contact.create(contact)
  25. new_contacts = app.contact.get_contact_list()
  26. assert len(old_contacts) + 1 == len(new_contacts)
  27. old_contacts.append(contact)
  28.  
  29. def id_or_max(cnt):
  30. if cnt.id:
  31. return int(cnt.id)
  32. else:
  33. return maxsize
  34. > assert sorted(old_contacts, key=id_or_max) == sorted(new_contacts, key=id_or_max)
  35. E assert [67:stop Pier...mesecond, ...] == [67:stop Pierr...mesecond, ...]
  36. E At index 8 diff: None:Pierre != 76:stop Pierre 3096- rue goyer 1@sto.com\n2@sto.com\n3@sto.com 514\n515\n516\nhomesecond
  37. E Use -v to get the full diff
  38.  
  39. test_add_contact.py:21: AssertionError
  40. [100%]
  41.  
  42. ================================== FAILURES ===================================
  43. ______________________________ test_add_contact _______________________________
  44.  
  45. app = <fixture.application.Application object at 0x034D1530>
  46.  
  47. def test_add_contact(app):
  48. old_contacts = app.contact.get_contact_list()
  49. contact = Contact(first_name="Pierre", middlename="sto", lastname="stop", nickname="nik", title="title", company_name="Company", address="3096- rue goyer", home_phone="514", mobile_phone="515",
  50. work_phone="516", fax="517", email="1@sto.com", second_email="2@sto.com", third_email="3@sto.com", homepage="sto.com", birthdate="18", birthmonth="January", birth_year="1971",
  51. anniversary_day="18", anniversary_month="February", anniversary_year="2018", second_address="address second", second_home="home second", notes="notes")
  52. app.contact.create(contact)
  53. new_contacts = app.contact.get_contact_list()
  54. assert len(old_contacts) + 1 == len(new_contacts)
  55. old_contacts.append(contact)
  56.  
  57. def id_or_max(cnt):
  58. if cnt.id:
  59. return int(cnt.id)
  60. else:
  61. return maxsize
  62. > assert sorted(old_contacts, key=id_or_max) == sorted(new_contacts, key=id_or_max)
  63. E assert [67:stop Pier...mesecond, ...] == [67:stop Pierr...mesecond, ...]
  64. E At index 8 diff: None:Pierre != 76:stop Pierre 3096- rue goyer 1@sto.com\n2@sto.com\n3@sto.com 514\n515\n516\nhomesecond
  65. E Use -v to get the full diff
  66.  
  67. test_add_contact.py:21: AssertionError
  68. ========================== 1 failed in 11.76 seconds ==========================
  69. Process finished with exit code 0
Add Comment
Please, Sign In to add comment