previously only the full path was supplied, producing long stored
filenames with the slashes in the path replaced by dashes
t/data/known_pod_issues.txt
t/data/t101.jpg
t/data/templates/gentest.tmpl
t/data/known_pod_issues.txt
t/data/t101.jpg
t/data/templates/gentest.tmpl
t/t000load.t
t/t00smoke.t makes a request to most of the scripts
t/tags/bse.cfg
t/t000load.t
t/t00smoke.t makes a request to most of the scripts
t/tags/bse.cfg
use BSE::TB::Products;
use BSE::TB::OtherParents;
use BSE::TB::Products;
use BSE::TB::OtherParents;
die "File '$file' not found for image$image_index\n";
}
die "File '$file' not found for image$image_index\n";
}
- my %opts = ( file => $full_file );
+ my %opts =
+ (
+ file => $full_file,
+ display_name => $file,
+ );
for my $key (qw/alt name url storage/) {
my $fkey = "image${image_index}_$key";
$entry->{$fkey}
for my $key (qw/alt name url storage/) {
my $fkey = "image${image_index}_$key";
$entry->{$fkey}
eval "require Text::CSV;"
or plan skip_all => "Text::CSV not available";
}
eval "require Text::CSV;"
or plan skip_all => "Text::CSV not available";
}
BEGIN {
unshift @INC, File::Spec->catdir(BSE::Test::base_dir(), "cgi-bin", "modules");
BEGIN {
unshift @INC, File::Spec->catdir(BSE::Test::base_dir(), "cgi-bin", "modules");
target=Article
update_only=1
sep_char=\\t
target=Article
update_only=1
sep_char=\\t
ignore_missing=0
[import profile completefile$when]
ignore_missing=0
[import profile completefile$when]
map_file1_notes=10
map_file1_hide_from_list=11
skiplines=0
map_file1_notes=10
map_file1_hide_from_list=11
skiplines=0
ignore_missing=0
update_only=1
source=CSV
ignore_missing=0
update_only=1
source=CSV
linkAlias\tbody\tfile1_file\timage1_file
"alias$when"\t"This is the body text with multiple lines
linkAlias\tbody\tfile1_file\timage1_file
"alias$when"\t"This is the body text with multiple lines
-Yes, multiple lines with CSV!"\tt00smoke.t\tdata/t101.jpg
+Yes, multiple lines with CSV!"\ttestdata.txt\tt101.jpg
EOS
close $fh;
my $imp = BSE::Importer->new(cfg => $cfg, profile => "simpleupdate$when", callback => sub { note @_ });
EOS
close $fh;
my $imp = BSE::Importer->new(cfg => $cfg, profile => "simpleupdate$when", callback => sub { note @_ });
is(-s $images[0]->full_filename, -s "t/data/t101.jpg",
"check size matches source");
is(-s $images[0]->full_filename, -s "t/data/t101.jpg",
"check size matches source");
+ cmp_ok($images[0]->image, '!~', 'data', "check we don't pass full path as basename");
+
my @files = $testb->files;
is(@files, 1, "should be 1 file");
my @files = $testb->files;
is(@files, 1, "should be 1 file");
- is($files[0]->displayName, "t00smoke.t", "check display name");
- is(-s $files[0]->full_filename, -s "t/t00smoke.t", "check size");
+ is($files[0]->displayName, "testdata.txt", "check display name");
+ is(-s $files[0]->full_filename, -s "t/data/testdata.txt", "check size");
my $fh = File::Temp->new;
my $filename = $fh->filename;
print $fh <<EOS;
my $fh = File::Temp->new;
my $filename = $fh->filename;
print $fh <<EOS;
-"alias$when",t00smoke.t,test,"A Test File.txt",local,"A test file from BSE",1,1,1,"Some Notes",1
+"alias$when",testdata.txt,test,"A Test File.txt",local,"A test file from BSE",1,1,1,"Some Notes",1
EOS
close $fh;
my $imp = BSE::Importer->new(cfg => $cfg, profile => "completefile$when", callback => sub { note @_ });
EOS
close $fh;
my $imp = BSE::Importer->new(cfg => $cfg, profile => "completefile$when", callback => sub { note @_ });
my ($file) = grep $_->name eq "test", $testb->files;
ok($file, "found the file with name 'test'")
or skip "File not found", 9;
my ($file) = grep $_->name eq "test", $testb->files;
ok($file, "found the file with name 'test'")
or skip "File not found", 9;
- is(-s $file->full_filename, -s "t/t00smoke.t", "check size");
+ is(-s $file->full_filename, -s "t/data/testdata.txt", "check size");
is($file->displayName, "A Test File.txt", "displayName");
is($file->storage, "local", "storage");
is($file->description, "A test file from BSE", "description");
is($file->displayName, "A Test File.txt", "displayName");
is($file->storage, "local", "storage");
is($file->description, "A test file from BSE", "description");
or skip "File not found", 9;
is($file->description, "New description", "description");
# other fields should be unchanged
or skip "File not found", 9;
is($file->description, "New description", "description");
# other fields should be unchanged
- is(-s $file->full_filename, -s "t/t00smoke.t", "check size");
+ is(-s $file->full_filename, -s "t/data/testdata.txt", "check size");
is($file->displayName, "A Test File.txt", "displayName");
is($file->storage, "local", "storage");
is($file->forSale, 1, "forSale");
is($file->displayName, "A Test File.txt", "displayName");
is($file->storage, "local", "storage");
is($file->forSale, 1, "forSale");
--- /dev/null
+Sample file imported by tests in 130-importer/020-article.t