def test_stdin_args(self):
    buri1 = self.CreateVersionedBucket()
    ouri1 = self.CreateObject(bucket_uri=buri1,
                              object_name='foo',
                              contents='foocontents')
    self.CreateObject(bucket_uri=buri1, object_name='bar',
                      contents='barcontents')
    ouri3 = self.CreateObject(bucket_uri=buri1,
                              object_name='baz',
                              contents='bazcontents')
    buri2 = self.CreateVersionedBucket()
    ouri4 = self.CreateObject(bucket_uri=buri2,
                              object_name='moo',
                              contents='moocontents')
    self.AssertNObjectsInBucket(buri1, 3, versioned=True)
    self.AssertNObjectsInBucket(buri2, 1, versioned=True)

    objects_to_remove = ['%s#%s' % (suri(ouri1), urigen(ouri1)),
                         '%s#%s' % (suri(ouri3), urigen(ouri3)),
                         '%s#%s' % (suri(ouri4), urigen(ouri4))]
    stdin = '\n'.join(objects_to_remove)
    self._RunRemoveCommandAndCheck(['rm', '-I'],
                                   objects_to_remove=objects_to_remove,
                                   stdin=stdin)
    self.AssertNObjectsInBucket(buri1, 1, versioned=True)
    self.AssertNObjectsInBucket(buri2, 0, versioned=True)
Tests rm with the -I option.
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/tests/test_rm.py/TestRm.test_stdin_args