def test_init_raises_runtimeerror_if_output_exists(self, os_path_split_mock): os_path_split_mock.return_value = self.output_head, self.output_tail self.data.__contains__.return_value = True with self.assertRaises(RuntimeError): BaseSimulation(self.cluster, self.data, self.output, self.R, self.N)
def setUp(self, mock_method): self.mock_prepare_output_tables = mock_method self.cluster = sentinel.cluster self.data = sentinel.data self.output_path = sentinel.output_path self.n = sentinel.n self.simulation = BaseSimulation(self.cluster, self.data, self.output_path, self.n, progress=False)
def test_init_remove_output_if_output_exists_and_force( self, os_path_split_mock): os_path_split_mock.return_value = self.output_head, self.output_tail self.data.__contains__.return_value = True BaseSimulation(self.cluster, self.data, self.output, self.R, self.N, force=True) self.data.removeNode.assert_called_with(self.output, recursive=True)
def setUp(self, os_path_split_mock): self.output_head, self.output_tail = (sentinel.output_head, sentinel.output_tail) os_path_split_mock.return_value = self.output_head, self.output_tail self.output = sentinel.output self.cluster = sentinel.cluster self.data = MagicMock(name='data') self.R = sentinel.R self.N = sentinel.N self.simulation = BaseSimulation(self.cluster, self.data, self.output, self.R, self.N)