Example #1
0
 def put(self, x, timeout=None):
     testify.assert_is_not(timeout, None)
     if self.accepted:
         raise multiprocessing.queues.Full()
     else:
         self.accepted = True
         self.put_value = x
Example #2
0
 def put(self, x, timeout=None):
     testify.assert_is_not(timeout, None)
     if self.accepted:
         raise multiprocessing.queues.Full()
     else:
         self.accepted = True
         self.put_value = x
 def test_read_yaml_file_with_cache(self, load_patch, open_patch):
     expected = {'mmmm': 'tests'}
     filename = 'fake_fname_dos'
     service_configuration_lib.enable_yaml_cache()
     actual = service_configuration_lib._read_yaml_file(filename)
     actual_two = service_configuration_lib._read_yaml_file(filename)
     open_patch.assert_called_once_with(filename, 'r', encoding='UTF-8')
     load_patch.assert_called_once_with(
         open_patch.return_value.__enter__().read())
     T.assert_equal(expected, actual)
     T.assert_equal(expected, actual_two)
     # When we cache, we can NOT return a pointer to the original object
     # because the caller might mutate it. We need to ensure that
     # the returned object is a copy.
     T.assert_is_not(actual, actual_two)
Example #4
0
 def put(self, x, timeout=None):
     testify.assert_is_not(timeout, None)
Example #5
0
 def put(self, x, timeout=None):
     testify.assert_is_not(timeout, None)
     raise multiprocessing.queues.Full()
Example #6
0
 def put(self, x, timeout=None):
     testify.assert_is_not(timeout, None)
Example #7
0
 def put(self, x, timeout=None):
     testify.assert_is_not(timeout, None)
     raise multiprocessing.queues.Full()