def test_get_targets_multiple_stdin_null(self):
   inputs = ['a', 'b', 'c', 'd', 'e']
   sys.stdin = StringIO.StringIO('\0'.join(inputs))
   result = upload_to_google_storage.get_targets(
       ['-'],
       self.parser,
       True)
   self.assertEqual(result, inputs)
 def test_get_targets_multiple_stdin_null(self):
   inputs = ['a', 'b', 'c', 'd', 'e']
   sys.stdin = StringIO.StringIO('\0'.join(inputs))
   result = upload_to_google_storage.get_targets(
       ['-'],
       self.parser,
       True)
   self.assertEqual(result, inputs)
 def test_get_targets_passthrough(self):
     result = upload_to_google_storage.get_targets(
         ['a', 'b', 'c', 'd', 'e'], self.parser, False)
     self.assertEqual(result, ['a', 'b', 'c', 'd', 'e'])
 def test_get_targets_no_args(self):
     try:
         upload_to_google_storage.get_targets([], self.parser, False)
         self.fail()
     except SystemExit, e:
         self.assertEqual(e.code, 2)
 def test_get_targets_passthrough(self):
   result = upload_to_google_storage.get_targets(
       ['a', 'b', 'c', 'd', 'e'],
       self.parser,
       False)
   self.assertEqual(result, ['a', 'b', 'c', 'd', 'e'])
 def test_get_targets_no_args(self):
   try:
     upload_to_google_storage.get_targets([], self.parser, False)
     self.fail()
   except SystemExit, e:
     self.assertEqual(e.code, 2)
Example #7
0
 def test_get_targets_multiple_stdin(self):
     inputs = ['a', 'b', 'c', 'd', 'e']
     sys.stdin = StringIO(os.linesep.join(inputs))
     result = upload_to_google_storage.get_targets(['-'], self.parser,
                                                   False)
     self.assertEqual(result, inputs)