hammond-data: Remove leftover synchronous code.

This commit is contained in:
Jordan Petridis
2018-01-19 15:41:37 +02:00
parent b92ba7be76
commit 46b6c0d27e
9 changed files with 49 additions and 131 deletions
+1
View File
@@ -52,6 +52,7 @@ impl Default for Header {
impl Header {
#[allow(dead_code)]
// FIXME: should not return arc and stuff
pub fn new(content: Arc<Content>, sender: Sender<Action>) -> Arc<Header> {
let h = Header::default();
h.init(content, sender);
+2 -13
View File
@@ -117,12 +117,9 @@ pub fn add(id: i32, directory: &str, sender: Sender<Action>) {
mod tests {
use super::*;
use hyper::Client;
use hyper_tls::HttpsConnector;
use tokio_core::reactor::Core;
use hammond_data::{Episode, Source};
use hammond_data::dbqueries;
use hammond_data::pipeline::pipeline;
use hammond_data::utils::get_download_folder;
use std::{thread, time};
@@ -136,20 +133,12 @@ mod tests {
// THIS IS NOT A RELIABLE TEST
// Just quick sanity check
fn test_start_dl() {
let mut core = Core::new().unwrap();
let client = Client::configure()
.connector(HttpsConnector::new(4, &core.handle()).unwrap())
.build(&core.handle());
let url = "http://www.newrustacean.com/feed.xml";
// Create and index a source
let source = Source::from_url(url).unwrap();
// Copy it's id
let sid = source.id();
// Convert Source it into a future Feed and index it
let future = source.into_feed(&client, true);
let feed = core.run(future).unwrap();
feed.index().unwrap();
pipeline(vec![source], true).unwrap();
// Get the Podcast
let pd = dbqueries::get_podcast_from_source_id(sid).unwrap();
+2 -13
View File
@@ -83,30 +83,19 @@ mod tests {
use super::*;
use hammond_data::Source;
use hammond_data::dbqueries;
use hyper::Client;
use hyper_tls::HttpsConnector;
use tokio_core::reactor::Core;
use hammond_data::pipeline::pipeline;
#[test]
// This test inserts an rss feed to your `XDG_DATA/hammond/hammond.db` so we make it explicit
// to run it.
#[ignore]
fn test_get_pixbuf_from_path() {
let mut core = Core::new().unwrap();
let client = Client::configure()
.connector(HttpsConnector::new(4, &core.handle()).unwrap())
.build(&core.handle());
let url = "http://www.newrustacean.com/feed.xml";
// Create and index a source
let source = Source::from_url(url).unwrap();
// Copy it's id
let sid = source.id();
// Convert Source it into a future Feed and index it
let future = source.into_feed(&client, true);
let feed = core.run(future).unwrap();
feed.index().unwrap();
pipeline(vec![source], true).unwrap();
// Get the Podcast
let pd = dbqueries::get_podcast_from_source_id(sid).unwrap();