Skip to content

Remove integration tests from torrent-repository package #1520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions packages/torrent-repository/src/swarm.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! A swarm is a collection of peers that are all trying to download the same
//! torrent.
use std::collections::BTreeMap;
use std::fmt::Debug;
use std::hash::{Hash, Hasher};
use std::net::SocketAddr;
use std::sync::Arc;

Expand All @@ -24,31 +22,6 @@ pub struct Swarm {
event_sender: Sender,
}

#[allow(clippy::missing_fields_in_debug)]
impl Debug for Swarm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Swarm")
.field("peers", &self.peers)
.field("metadata", &self.metadata)
.finish()
}
}

impl Hash for Swarm {
fn hash<H: Hasher>(&self, state: &mut H) {
self.peers.hash(state);
self.metadata.hash(state);
}
}

impl PartialEq for Swarm {
fn eq(&self, other: &Self) -> bool {
self.peers == other.peers && self.metadata == other.metadata
}
}

impl Eq for Swarm {}

impl Swarm {
#[must_use]
pub fn new(info_hash: &InfoHash, downloaded: u32, event_sender: Sender) -> Self {
Expand Down Expand Up @@ -329,16 +302,6 @@ mod tests {
use crate::swarm::Swarm;
use crate::tests::sample_info_hash;

#[test]
fn it_should_allow_debugging() {
let swarm = Swarm::new(&sample_info_hash(), 0, None);

assert_eq!(
format!("{swarm:?}"),
"Swarm { peers: {}, metadata: SwarmMetadata { downloaded: 0, complete: 0, incomplete: 0 } }"
);
}

#[test]
fn it_should_be_empty_when_no_peers_have_been_inserted() {
let swarm = Swarm::new(&sample_info_hash(), 0, None);
Expand Down
1 change: 0 additions & 1 deletion packages/torrent-repository/src/swarms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ impl Swarms {
/// # Errors
///
/// This function panics if the lock for the swarm handle cannot be acquired.
#[allow(clippy::await_holding_lock)]
pub async fn handle_announcement(
&self,
info_hash: &InfoHash,
Expand Down
1 change: 0 additions & 1 deletion packages/torrent-repository/tests/common/mod.rs

This file was deleted.

106 changes: 0 additions & 106 deletions packages/torrent-repository/tests/common/torrent_peer_builder.rs

This file was deleted.

22 changes: 0 additions & 22 deletions packages/torrent-repository/tests/integration.rs

This file was deleted.

Loading
Loading