예제 #1
0
 def test_no_runs_available(self):
     stream = six.StringIO()
     formatter = ListRunsFormatter(stream)
     objects = []
     formatter.display_objects_to_user(objects)
     self.assertEqual(
         [line.strip() for line in stream.getvalue().splitlines()],
         [line.strip() for line in EMPTY_RUNS.splitlines()])
예제 #2
0
 def test_no_runs_available(self):
     stream = six.StringIO()
     formatter = ListRunsFormatter(stream)
     objects = []
     formatter.display_objects_to_user(objects)
     self.assertEqual(
         [line.strip() for line in stream.getvalue().splitlines()],
         [line.strip() for line in EMPTY_RUNS.splitlines()])
예제 #3
0
 def test_single_row(self):
     objects = [
         {'@componentParent': 'parent',
          '@id': 'id',
          '@scheduledStartTime': 'now',
          '@status': 'status',
          '@actualStartTime': 'actualStartTime',
          '@actualEndTime': 'actualEndTime',
         }
     ]
     stream = six.StringIO()
     formatter = ListRunsFormatter(stream)
     formatter.display_objects_to_user(objects)
     # Rather than stream.getvalue() == SINGLE_ROW_RUN
     # we compare equality like this to avoid test failures
     # for differences in leading/trailing whitespace and empty lines.
     self.assertEqual(
         [line.strip() for line in stream.getvalue().splitlines()
          if line.strip()],
         [line.strip() for line in SINGLE_ROW_RUN.splitlines()
          if line.strip()])
예제 #4
0
 def test_single_row(self):
     objects = [{
         '@componentParent': 'parent',
         '@id': 'id',
         '@scheduledStartTime': 'now',
         '@status': 'status',
         '@actualStartTime': 'actualStartTime',
         '@actualEndTime': 'actualEndTime',
     }]
     stream = six.StringIO()
     formatter = ListRunsFormatter(stream)
     formatter.display_objects_to_user(objects)
     # Rather than stream.getvalue() == SINGLE_ROW_RUN
     # we compare equality like this to avoid test failures
     # for differences in leading/trailing whitespace and empty lines.
     self.assertEqual([
         line.strip()
         for line in stream.getvalue().splitlines() if line.strip()
     ], [
         line.strip()
         for line in SINGLE_ROW_RUN.splitlines() if line.strip()
     ])