Example #1
0
 def setUp(self):
     """
     Just sets up a containerManager with an empty popen_ref.
     Functions that want to test containerManager's handling of stdout output should make a new manager.
     :return:
     """
     self.manager = containerManager.ContainerManager(PopenRefMock())
Example #2
0
 def test_no_popenref_shouldfail(self):
     """
     Tests that containerManager raises a ValueError if no popen is given.
     """
     #We must use lambda here because pyunit expects a callable
     self.assertRaises(ValueError,
                       lambda: containerManager.ContainerManager())
Example #3
0
 def test_one_line_output_should_become_done(self):
     self.manager = containerManager.ContainerManager(
         PopenRefMock(
             "INFO:2015-04-19 22:20:54,020 Creating Whisper database with uuid 1"
         ))
     while not self.manager.status:
         pass
     self.assertTrue(self.manager.status)
Example #4
0
 def test_one_line_unicode_output_should_one_output(self):
     self.manager = containerManager.ContainerManager(
         PopenRefMock(
             u"INFO:2015-04-19 22:20:54,020 Creating Whisper database with uuid 1"
         ))
     while not self.manager.status:
         pass
     self.assertTrue(len(self.manager.output) == 1)
Example #5
0
 def test_one_line_output_should_one_output(self):
     """
     Tests that containerManager gets one line of output after processing one line from stdout.
     """
     self.manager = containerManager.ContainerManager(
         PopenRefMock(
             "INFO:2015-04-19 22:20:54,020 Creating Whisper database with uuid 1"
         ))
     while not self.manager.status:
         pass
     self.assertTrue(len(self.manager.output) == 1)