Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rows = pd.DataFrame({'schema': {'names': ['id', 'name', 'last name']}})
- class TestMappingTableTestCase(unittest.TestCase):
- def test_mysql_list_contents(self):
- """ Match the contents of My_list to Expected result"""
- my_list = rows.schema.names
- expected = ['id', 'name', 'last name']
- self.assertEqual(my_list, expected)
- Traceback (most recent call last):
- File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 59, in testPartExecutor
- yield
- File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 605, in run
- testMethod()
- File "C:UsersgreatmanDocumentsdata_archivalunit_testsrecords_for_mapping_table.py", line 45, in test_my_list_contents
- self.assertListEqual(mysql_list, expected)
- File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 1028, in assertListEqual
- self.assertSequenceEqual(list1, list2, msg, seq_type=list)
- File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 1010, in assertSequenceEqual
- self.fail(msg)
- File "C:UsersgreatmanAppDataLocalProgramsPythonPython36-32libunittestcase.py", line 670, in fail
- raise self.failureException(msg)
- AssertionError: Lists differ: ['last name'] != ['id', 'name', 'last name']
- First differing element 0:
- 'last name'
- 'id'
- Second list contains 2 additional elements.
- First extra element 1:
- 'name'
- - ['last name']
- + ['id', 'name', 'last name']
Add Comment
Please, Sign In to add comment