def test_lookup_version_without_credentials(self):
   """Tests that gsutil tarball version lookup works without credentials."""
   with SetBotoConfigForTest([('GSUtil', 'software_update_check_period', '1')],
                             use_existing_config=False):
     self.command_runner = command_runner.CommandRunner()
     # Looking up software version shouldn't get auth failure exception.
     self.command_runner.RunNamedCommand('ls', [GSUTIL_PUB_TARBALL])
Beispiel #2
0
 def test_lookup_version_without_credentials(self):
     """
 Tests that gsutil tarball version lookup works without credentials.
 """
     self.command_runner = command_runner.CommandRunner(config_file_list=[])
     # Looking up software version shouldn't get auth failure exception.
     self.command_runner.RunNamedCommand('ls', [GSUTIL_PUB_TARBALL])
Beispiel #3
0
 def test_lookup_version_without_credentials(self):
   """Tests that gsutil tarball version lookup works without credentials."""
   with SetBotoConfigFileForTest(self.CreateTempFile(
       contents='[GSUtil]\nsoftware_update_check_period=1')):
     self.command_runner = command_runner.CommandRunner()
     # Looking up software version shouldn't get auth failure exception.
     self.command_runner.RunNamedCommand('ls', [GSUTIL_PUB_TARBALL])
Beispiel #4
0
    def setUp(self):
        super(TestCommandRunnerIntegrationTests, self).setUp()

        # Mock out the timestamp file so we can manipulate it.
        self.previous_update_file = (
            command_runner.LAST_CHECKED_FOR_GSUTIL_UPDATE_TIMESTAMP_FILE)
        self.timestamp_file = self.CreateTempFile(contents='0')
        command_runner.LAST_CHECKED_FOR_GSUTIL_UPDATE_TIMESTAMP_FILE = (
            self.timestamp_file)

        # Mock out raw_input to trigger yes prompt.
        command_runner.raw_input = lambda p: 'y'

        # Create a credential-less boto config file.
        self.orig_config = boto.config
        config_file = path = self.CreateTempFile(
            contents='[GSUtil]\nsoftware_update_check_period=1')
        boto.config = Config(path=config_file)
        # Need to copy config into boto.connection.config because it gets loaded
        # before tests run.
        boto.connection.config = boto.config
        self.command_runner = command_runner.CommandRunner(config_file)