Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make stuff work in a basic way

  • Loading branch information...
commit 529cd6ceedba65e8511c05b14e8804795d41afd1 1 parent 132e1e4
@leto authored
View
5 lib/WWW/PhyloBox.pm
@@ -41,10 +41,9 @@ This talks to PhyloBox
sub create {
my ($self, %args) = @_;
-
my $response = $self->ua->post(
- $self->base_url . "/tree/edit",
- %args,
+ $self->base_url . "/new",
+ \%args,
);
warn Dumper [ $response ];
}
View
7 t/01-post-newick.t
@@ -7,12 +7,13 @@ plan( tests => 2 );
my $phylobox = WWW::PhyloBox->new;
my $newick = slurp("t/data/foo.newick");
-isa_ok($phylobox, 'WWW::Phylobox');
+isa_ok($phylobox, 'WWW::PhyloBox');
lives_ok {
$phylobox->create(
- method => "phyloxml",
- phyloxml => $newick,
+ method => "newick",
+ phyloFile => $newick,
+ response => "key",
)
}, 'creating newick';
View
34 t/02-create-phyloxml.t
@@ -1,17 +1,33 @@
use Test::Most;
use WWW::PhyloBox;
+
use File::Slurp qw/slurp/;
-plan( tests => 2 );
+plan( tests => 3 );
my $phylobox = WWW::PhyloBox->new;
-my $phyloxml = slurp("t/data/phylo.xml");
+my $phyloxml = slurp("t/data/test.xml");
+
+{
+ isa_ok($phylobox, 'WWW::PhyloBox');
-isa_ok($phylobox, 'WWW::Phylobox');
+ lives_ok {
+ $phylobox->create(
+ method => "phyloxml",
+ phyloFile => $phyloxml,
+ response => "key",
+ )
+ }, 'creating phyloxml';
+}
-lives_ok {
- $phylobox->create(
- method => "phyloxml",
- phyloxml => $phyloxml,
- )
-}, 'creating phyloxml';
+{
+ my $phyloxml = slurp("t/data/phylo.xml");
+ lives_ok {
+ $phylobox->create(
+ method => "phyloxml",
+ phyloFile => $phyloxml,
+ response => "key",
+ )
+ }, 'creating phyloxml';
+ # need to check return code
+}
View
106 t/data/test.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phyloxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.phyloxml.org http://www.phyloxml.org/1.10/phyloxml.xsd" xmlns="http://www.phyloxml.org">
+<phylogeny rooted="true">
+ <clade>
+ <clade>
+ <clade>
+ <clade>
+ <node_id>3048</node_id>
+ <name>Baeolophus atricristatus</name>
+ <taxonomy>
+ <scientific_name>Baeolophus atricristatus</scientific_name>
+ </taxonomy>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <branchcolor>ffc000</branchcolor>
+ <distribution>
+ <point><lat>30.0</lat><lon>-103</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ <clade>
+ <name>Baeolophus bicolor</name>
+ <taxonomy>
+ <scientific_name>Baeolophus bicolor</scientific_name>
+ </taxonomy>
+ <branchcolor>ff2a00</branchcolor>
+ <clade>
+ <node_id>30853</node_id>
+ <name>Baeolophus bicolor</name>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>42.0</lat><lon>-80.0</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ <clade>
+ <node_id>9484</node_id>
+ <name>Baeolophus bicolor</name>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>42.0</lat><lon>-79.0</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ </clade>
+ </clade>
+ <clade>
+ <clade>
+ <name>Baeolophus ridgwayi</name>
+ <taxonomy>
+ <scientific_name>Baeolophus bicolor</scientific_name>
+ </taxonomy>
+ <branchcolor>ff00fa</branchcolor>
+ <clade>
+ <node_id>41537</node_id>
+ <name>Baeolophus ridgwayi</name>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>35.0</lat><lon>-106.0</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ <clade>
+ <node_id>47712</node_id>
+ <name>Baeolophus ridgwayi</name>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>35.0</lat><lon>-115.0</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ </clade>
+ <clade>
+ <name>Baeolophus inornatus</name>
+ <taxonomy>
+ <scientific_name>Baeolophus inornatus</scientific_name>
+ </taxonomy>
+ <branchcolor>7fff00</branchcolor>
+ <clade>
+ <node_id>57760</node_id>
+ <name>Baeolophus inornatus</name>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>29.99</lat><lon>-116.0</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ <clade>
+ <node_id>57761</node_id>
+ <name>Baeolophus inornatus</name>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>29.99</lat><lon>-116.02</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ </clade>
+ </clade>
+ </clade>
+ <clade>
+ <node_id>41536</node_id>
+ <name>Baeolophus wollweberi</name>
+ <taxonomy>
+ <scientific_name>Baeolophus wollweberi</scientific_name>
+ </taxonomy>
+ <branchcolor>00fffa</branchcolor>
+ <uri type="icon">http://geophylo.appspot.com/static_files/icons/01.png</uri>
+ <distribution>
+ <point><lat>31.0</lat><lon>-109.0</lon><alt>0</alt></point>
+ </distribution>
+ </clade>
+ </clade>
+</phylogeny>
+</phyloxml>
Please sign in to comment.
Something went wrong with that request. Please try again.