def test_remove_series_happy_path(series, config): config['series'].append(series) # Create a directory for the series... os.mkdir(os.path.join(config['working_directory'], 'Brooklyn Nine-Nine')) functions.remove_series(config, series) assert len(config['series']) == 0 assert len(open(config['config_path']).read()) == 91
def test_remove_series_with_non_existing_series_directory(series, config): config['series'].append(series) functions.remove_series(config, series) assert len(config['series']) == 0
def test_remove_series_with_non_existing_series(series, config): with pytest.raises(SeriesbutlerException) as exceptionInfo: functions.remove_series(config, series) assert (str(exceptionInfo.value) == 'The given series is not registered ' 'in the given configuration!')