Guest User

Untitled

a guest
Mar 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. rows = pd.DataFrame({'schema': {'names': ['id', 'name', 'last name']}})
  2.  
  3. class TestMappingTableTestCase(unittest.TestCase):
  4. def test_mysql_list_contents(self):
  5. """ Match the contents of My_list to Expected result"""
  6. my_list = rows.schema.names
  7. expected = ['id', 'name', 'last name']
  8. self.assertEqual(my_list, expected)
  9.  
  10. Traceback (most recent call last):
  11. File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 59, in testPartExecutor
  12. yield
  13. File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 605, in run
  14. testMethod()
  15. File "C:UsersgreatmanDocumentsdata_archivalunit_testsrecords_for_mapping_table.py", line 45, in test_my_list_contents
  16. self.assertListEqual(mysql_list, expected)
  17. File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 1028, in assertListEqual
  18. self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  19. File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 1010, in assertSequenceEqual
  20. self.fail(msg)
  21. File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 670, in fail
  22. raise self.failureException(msg)
  23. AssertionError: Lists differ: ['last name'] != ['id', 'name', 'last name']
  24.  
  25. First differing element 0:
  26. 'last name'
  27. 'id'
  28.  
  29. Second list contains 2 additional elements.
  30. First extra element 1:
  31. 'name'
  32.  
  33. - ['last name']
  34. + ['id', 'name', 'last name']
Add Comment
Please, Sign In to add comment