'Testing the init method of DownloadState'

def test_init(self):

    download_state = DownloadState(self.mock_download, DLSTATUS_DOWNLOADING, 'error', 0.5)
    self.assertEqual(download_state.get_error(), 'error')
    download_state = DownloadState(self.mock_download, DLSTATUS_SEEDING, None, 0.5)
    self.assertEqual(download_state.get_status(), DLSTATUS_SEEDING)
    download_state = DownloadState(self.mock_download, DLSTATUS_SEEDING, 'error', 0.5, stats={})
    self.assertEqual(download_state.get_status(), DLSTATUS_STOPPED_ON_ERROR)
    download_state = DownloadState(self.mock_download, DLSTATUS_WAITING4HASHCHECK, None, 0.5, stats={})
    self.assertEqual(download_state.get_progress(), 0.0)
    download_state = DownloadState(self.mock_download, DLSTATUS_STOPPED, None, 0.5, stats={'frac': 0.6})
    self.assertEqual(download_state.get_progress(), 0.6)
