Project

General

Profile

Revision c06f1783

Added by Thomas McKay over 6 years ago

fixes #15743 - import and export of subscriptions one-per-line

View differences:

test/resources/subscriptions_test.rb
10 10
      stdout,stderr = capture {
11 11
        hammer.run(%W{csv subscriptions --help})
12 12
      }
13
      assert_equal stderr, ''
13
      assert_equal '', stderr
14 14
      assert_equal stdout, <<-HELP
15 15
Usage:
16 16
     csv subscriptions [OPTIONS]
......
35 35
      # rubocop:disable LineLength
36 36
      file.write <<-FILE
37 37
Name,Organization,Manifest File,Subscription Name,Quantity,Product SKU,Contract Number,Account Number
38
Manifest,Example Corporation,./test/data/doesnotexist.zip
39
# Manifest Name,Example Corporation,ExampleCorp
40
# Manifest URL,Example Corporation,https://access.stage.redhat.com/management/distributors/1234
38
Manifest,Test Corporation,./test/data/doesnotexist.zip
39
# Manifest Name,Test Corporation,ExampleCorp
40
# Manifest URL,Test Corporation,https://access.stage.redhat.com/management/distributors/1234
41 41
FILE
42 42
      file.rewind
43 43

  
44 44
      stdout,stderr = capture {
45 45
        hammer.run(%W{csv subscriptions --verbose --file #{file.path}})
46 46
      }
47
      assert_equal stdout, ''
47
      assert_equal '', stdout
48 48
      lines = stderr.split("\n")
49
      assert_equal lines[0], "Manifest upload failed:"
49
      assert_equal "Manifest upload failed:", lines[0]
50 50
      assert_match(/.*Error: No such file or directory.*/, lines[1])
51 51
      file.unlink
52 52
      stop_vcr

Also available in: Unified diff