|
45 | 45 | end |
46 | 46 |
|
47 | 47 | it "entities_export, entities_import" do |
48 | | - begin |
49 | | - op = nil |
50 | | - out, _err = capture_io do |
51 | | - op = entities_export project_id: project_id, output_url_prefix: output_url_prefix |
52 | | - end |
53 | | - assert_includes out, "Entities were exported" |
54 | | - assert op |
55 | | - assert op.response |
56 | | - assert_equal "#{output_url_prefix}/#{storage_file_prefix}.overall_export_metadata", op.response.output_url |
| 48 | + op = nil |
| 49 | + out, _err = capture_io do |
| 50 | + op = entities_export project_id: project_id, output_url_prefix: output_url_prefix |
| 51 | + end |
| 52 | + assert_includes out, "Entities were exported" |
| 53 | + assert op |
| 54 | + assert op.response |
| 55 | + assert_equal "#{output_url_prefix}/#{storage_file_prefix}.overall_export_metadata", op.response.output_url |
57 | 56 |
|
58 | | - out, _err = capture_io do |
59 | | - entities_import project_id: project_id, input_url: op.response.output_url |
60 | | - end |
61 | | - assert_includes out, "Entities were imported" |
62 | | - ensure |
63 | | - # cleanup: delete exported objects |
64 | | - require "google/cloud/storage" |
65 | | - storage = Google::Cloud::Storage.new |
66 | | - files = storage.bucket(storage_bucket_name).files prefix: storage_file_prefix |
67 | | - files.each do |f| |
68 | | - f.delete |
69 | | - puts "Deleted: #{f.name}" |
70 | | - end |
| 57 | + out, _err = capture_io do |
| 58 | + entities_import project_id: project_id, input_url: op.response.output_url |
| 59 | + end |
| 60 | + assert_includes out, "Entities were imported" |
| 61 | + ensure |
| 62 | + # cleanup: delete exported objects |
| 63 | + require "google/cloud/storage" |
| 64 | + storage = Google::Cloud::Storage.new |
| 65 | + files = storage.bucket(storage_bucket_name).files prefix: storage_file_prefix |
| 66 | + files.each do |f| |
| 67 | + f.delete |
| 68 | + puts "Deleted: #{f.name}" |
71 | 69 | end |
72 | 70 | end |
73 | 71 | end |
0 commit comments