def test__process_generic(self): """ Test replacement of key '_' with " " using _process_generic method. """ MOCK_MediaInfoFetcher.reset_mock() keys = ['some_key'] track = OrderedDict([('some_key', 'test')]) result = MediaInfoFetcher._process_generic(MOCK_MediaInfoFetcher, track, keys) self.assertEqual(result['some key'], track['some_key'])
def test__process_generic(self): """Test replacement of key '_' with " " using _process_generic method.""" MOCK_MediaInfoFetcher.reset_mock() keys = ['some_key', 'FileSize', 'Duration'] track = OrderedDict([('some_key', 'test'), ('FileSize', '1048576'), ('Duration', '60')]) result = MediaInfoFetcher._process_generic(MOCK_MediaInfoFetcher, track, keys) self.assertEqual(result['some key'], track['some_key']) self.assertEqual(result['FileSize'], '1.0 MB') self.assertEqual(result['Duration'], '1m 0s')