def __test_backend_support(self, _): self.manager.connection = MagicMock(return_value=self.connection) external_tables_view = ExternalTablesView(cmd='') external_tables_view.nodes(**self.function_parameters) self.manager.connection.assert_called_with( **self.expected_manager_connection_to_be_called_with) self.assertEquals(self.manager, external_tables_view.manager) self.assertEquals(self.connection, external_tables_view.connection)
def __test_backend_support(self, _): self.manager.connection = MagicMock(return_value=self.connection) external_tables_view = ExternalTablesView(cmd='') external_tables_view.nodes(**self.function_parameters) self.manager.connection.assert_called_with( **self.expected_manager_connection_to_be_called_with ) self.assertEquals(self.manager, external_tables_view.manager) self.assertEquals(self.connection, external_tables_view.connection)
def __test_nodes(self, internal_server_error_mock, make_json_response_mock, render_template_mock): external_tables_view = ExternalTablesView(cmd='') external_tables_view.nodes(**self.function_parameters) if hasattr(self, 'expected_internal_server_error_called_with'): internal_server_error_mock.assert_called_with( **self.expected_internal_server_error_called_with) else: internal_server_error_mock.assert_not_called() if hasattr(self, 'expected_make_json_response_called_with'): make_json_response_mock.assert_called_with( **self.expected_make_json_response_called_with) else: make_json_response_mock.assert_not_called() render_template_mock.assert_called_with( self.expect_render_template_called_with)
def __test_nodes(self, internal_server_error_mock, make_json_response_mock, render_template_mock): external_tables_view = ExternalTablesView(cmd='') external_tables_view.nodes(**self.function_parameters) if hasattr(self, 'expected_internal_server_error_called_with'): internal_server_error_mock.assert_called_with( **self.expected_internal_server_error_called_with ) else: internal_server_error_mock.assert_not_called() if hasattr(self, 'expected_make_json_response_called_with'): make_json_response_mock.assert_called_with( **self.expected_make_json_response_called_with ) else: make_json_response_mock.assert_not_called() render_template_mock.assert_called_with( self.expect_render_template_called_with )