def test_gets_and_sets(self): model = Model() model.setFilePath("C:\bookmark.html") model.setOutputPath("C:\downloads") model.setOutputFormat(Format.WAV) model.setOutputTitleFormat(titleFormat.USE_YOUTUBE_TITLE) model.setOutputQuality(Quality.HIGH) model.setStatus(State.OPENING_FILE) self.assertEqual(model.getFilePath(), "C:\bookmark.html") self.assertEqual(model.getOutputPath(), "C:\downloads") self.assertEqual(model.getOutputFormat(), Format.WAV) self.assertEqual(model.getOutputTitleFormat(), titleFormat.USE_YOUTUBE_TITLE) self.assertEqual(model.getOutputQuality(), Quality.HIGH) self.assertEqual(model.getStatus(), State.OPENING_FILE)
def test_disable_setters_when_downloading(self): model = Model() model.setFilePath("A") model.setOutputPath("A") model.setOutputFormat(Format.FLV) model.setOutputTitleFormat(titleFormat.USE_BOOKMARK_TITLE) model.setOutputQuality(Quality.NORMAL) model.setStatus(State.DOWNLOADING) model.setFilePath("B") model.setOutputPath("B") model.setOutputFormat(Format.WAV) model.setOutputTitleFormat(titleFormat.USE_YOUTUBE_TITLE) model.setOutputQuality(Quality.HIGH) self.assertEqual(model.getFilePath(), "A") self.assertEqual(model.getOutputPath(), "A") self.assertEqual(model.getOutputFormat(), Format.FLV) self.assertEqual(model.getOutputTitleFormat(), titleFormat.USE_BOOKMARK_TITLE) self.assertEqual(model.getOutputQuality(), Quality.NORMAL)