Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)