'Testing various getters and setters in DownloadState'

def test_getters_setters_2(self):

    download_state = DownloadState(self.mock_download, DLSTATUS_DOWNLOADING, None, 0.5)
    stats = {'up': 123, 'down': 1234, 'stats': self.mock_transferred, 'time': 42, 'vod_prebuf_frac_consec': 43, 'vod_prebuf_frac': 44, 'vod': True, 'tracker_status': {'a': 'b'}}
    download_state.stats = stats
    self.assertEqual(download_state.get_current_speed(UPLOAD), 123)
    self.assertEqual(download_state.get_current_speed(DOWNLOAD), 1234)
    self.assertEqual(download_state.get_total_transferred(UPLOAD), 5)
    self.assertEqual(download_state.get_total_transferred(DOWNLOAD), 6)
    self.assertEqual(download_state.get_vod_prebuffering_progress_consec(), 43)
    self.assertTrue(download_state.is_vod())
    self.assertEqual(download_state.get_tracker_status(), {'a': 'b'})
    seeding_stats = {'total_down': 8, 'total_up': 9, 'ratio': 0.42}
    download_state.set_seeding_statistics(seeding_stats)
    self.assertEqual(download_state.get_seeding_statistics(), seeding_stats)
    self.assertEqual(download_state.seeding_downloaded, 8)
    self.assertEqual(download_state.seeding_uploaded, 9)
    self.assertEqual(download_state.seeding_ratio, 0.42)
    self.assertEqual(download_state.get_eta(), 42)
    self.assertEqual(download_state.get_num_con_initiated(), 10)
    self.assertEqual(download_state.get_num_peers(), 23)
    self.assertEqual(download_state.get_num_nonseeds(), 12)
    self.assertEqual(download_state.get_num_seeds_peers(), (11, 12))
    self.assertEqual(download_state.get_pieces_complete(), [])
    self.assertEqual(download_state.get_pieces_total_complete(), (0, 0))
    download_state.haveslice = [1, 2, 3]
    self.assertEqual(download_state.get_pieces_complete(), [1, 2, 3])
    self.assertEqual(download_state.get_pieces_total_complete(), (3, 6))
    self.mock_download.get_selected_files = (lambda : ['test'])
    self.assertEqual(download_state.get_selected_files(), ['test'])
    self.assertEqual(download_state.get_length(), 43)
