Beispiel #1
0
 def testFinishMarker(self):
     resource = [[1, 2, 3], ['a', 'b', 'c'],
                 resource_printer_base.FinishMarker()]
     expected = [[1, 2, 3], ['a', 'b', 'c'], 'Finish', 'Finish']
     printer = MockPrinter()
     printer.Print(resource)
     actual = printer.GetTestOutput()
     self.assertEqual(expected, actual)
Beispiel #2
0
  def Run(self, args):
    """Runs the list command."""
    result = self.group.update_manager.List()
    (to_print, self._current_version, self._latest_version) = result
    if not to_print:
      raise StopIteration

    for c in to_print:
      yield c
    yield resource_printer_base.FinishMarker()
Beispiel #3
0
 def testIsResourceMarker(self):
     resource = [[1, 2, 3], ['a', 'b', 'c'],
                 resource_printer_base.PageMarker(), [7, 8, 9],
                 ['x', 'y', 'z'],
                 resource_printer_base.FinishMarker()]
     expected = [False, False, True, False, False, True]
     actual = []
     for record in resource:
         actual.append(resource_printer_base.IsResourceMarker(record))
     self.assertEqual(expected, actual)
Beispiel #4
0
    def Run(self, args):
        """Runs the list command."""
        update_manager = util.GetUpdateManager(args)
        result = update_manager.List(show_hidden=args.show_hidden)
        (to_print, self._current_version, self._latest_version) = result
        if not to_print:
            raise StopIteration

        for c in to_print:
            yield c
        yield resource_printer_base.FinishMarker()
Beispiel #5
0
    def Run(self, args):
        """Runs the list command."""
        result = self.group.update_manager.List()
        (to_print, current_version, latest_version) = result
        if not to_print:
            raise StopIteration

        for c in to_print:
            yield c
        yield resource_printer_base.FinishMarker()

        log.status.write("""\
To install or remove components at your current SDK version [{current}], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [{latest}], run:
  $ gcloud components update

""".format(current=current_version, latest=latest_version))
        log.status.flush()