Made Disel NewModels private.

This commit is contained in:
Jordan Petridis
2017-11-22 05:50:25 +02:00
parent ee7c5ca26e
commit 9bc6df2cba
12 changed files with 35 additions and 51 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
use open;
use hammond_data::dbqueries;
use hammond_data::models::{Episode, Podcast};
use hammond_data::{Episode, Podcast};
use hammond_downloader::downloader;
use hammond_data::utils::*;
use hammond_data::errors::*;
+8 -10
View File
@@ -5,7 +5,7 @@ use gdk_pixbuf::Pixbuf;
use std::fs;
use hammond_data::dbqueries;
use hammond_data::models::Podcast;
use hammond_data::Podcast;
use hammond_downloader::downloader;
use widgets::episode::episodes_listbox;
@@ -118,19 +118,17 @@ pub fn update_podcast_widget(stack: &gtk::Stack, pd: &Podcast) {
#[cfg(test)]
mod tests {
use hammond_data::models::NewPodcast;
use hammond_data::Source;
use super::*;
#[test]
fn test_get_pixbuf_from_path() {
let pd = NewPodcast {
title: "New Rustacean".to_string(),
description: "".to_string(),
link: "".to_string(),
image_uri: Some("http://newrustacean.com/podcast.png".to_string()),
source_id: 0,
};
let pd = Podcast::from(pd);
let pd = Source::from_url("http://www.newrustacean.com/feed.xml")
.unwrap()
.refresh()
.unwrap()
.index_channel()
.unwrap();
let pxbuf = get_pixbuf_from_path(&pd);
assert!(pxbuf.is_some());