MAASServerTestCase.setUp() is overly broad

Bug #1427628 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned

Bug Description

There's code in MAASServerTestCase.setUp() that really ought to moved
into fixtures or be done for specific test cases, perhaps with
setUpClass(). It really does not belong here.

The current offenders:

  # This patch prevents communication with a non-existent cluster
  # controller when fetching power types.
  static_params = (
      provisioningserver.power_schema.JSON_POWER_TYPE_PARAMETERS)
  self.patch(
      power_parameters,
      'get_all_power_types_from_clusters').return_value = static_params

  # Disconnect the monitor cancellation as it's triggered by a signal.
  # Avoid circular imports.
  from maasserver import monitor_connect
  self.patch(monitor_connect, 'MONITOR_CANCEL_CONNECT', False)

  # Disconnect the status transition event to speed up tests.
  # Avoid circular imports.
  from maasserver import event_connect
  self.patch(event_connect, 'STATE_TRANSITION_EVENT_CONNECT', False)

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.