Update to API v2
[webservice-strike.git] / t / WebService-Strike-Torrent.t
CommitLineData
27da1d36
MG
1#!/usr/bin/perl
2use strict;
3use warnings;
4
5use Test::More tests => 14;
6BEGIN { use_ok('WebService::Strike::Torrent') }
7
8my %data = (
9 leeches => 13,
95b1c120
MG
10 size => 615514112,
11 torrent_hash => 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04',
27da1d36
MG
12 file_count => 1,
13 sub_category => '',
14 torrent_category => 'Applications',
95b1c120 15 file_info => {
27da1d36
MG
16 file_names => [ 'archlinux-2015.01.01-dual.iso' ],
17 file_lengths => [ 615514112 ],
95b1c120 18 },
27da1d36
MG
19 upload_date => 'Jan 6, 2015',
20 seeds => 645,
21 uploader_username => 'The_Doctor-',
95b1c120 22 magnet_uri => 'magnet:?xt=urn:btih:B425907E5755031BDA4A8D1B6DCCACA97DA14C04&dn=Arch+Linux+2015.01.01+%28x86%2Fx64%29&tr=udp://open.demonii.com:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://exodus.desync.com:6969',
27da1d36
MG
23 torrent_title => 'Arch Linux 2015.01.01 (x86/x64)'
24);
25
26my $t = WebService::Strike::Torrent->new(\%data);
27
28is $t->hash, 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04', 'hash';
29is $t->title, 'Arch Linux 2015.01.01 (x86/x64)', 'title';
30is $t->category, 'Applications', 'category';
31is $t->sub_category, '', 'sub_category';
32is $t->seeds, 645, 'seeds';
33is $t->leeches, 13, 'leeches';
34is $t->count, 1, 'count';
95b1c120 35is $t->size, 615514112, 'size';
f447922d 36is $t->date, 1420502400,'date';
27da1d36
MG
37is $t->uploader, 'The_Doctor-', 'uploader';
38is $t->names->[0], 'archlinux-2015.01.01-dual.iso', 'names';
39is $t->lengths->[0], 615514112, 'lengths';
95b1c120 40is $t->magnet, 'magnet:?xt=urn:btih:B425907E5755031BDA4A8D1B6DCCACA97DA14C04&dn=Arch+Linux+2015.01.01+%28x86%2Fx64%29&tr=udp://open.demonii.com:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://exodus.desync.com:6969', 'magnet';
This page took 0.012296 seconds and 4 git commands to generate.