~maas-committers/maas/trunk

« back to all changes in this revision

Viewing changes to src/maasserver/api/tests/test_nodes.py

  • Committer: MAAS Lander
  • Author(s): Mike Pontillo
  • Date: 2015-05-01 06:30:43 UTC
  • mfrom: (3853.1.5 wip)
  • Revision ID: maas_lander-20150501063043-95srhq7m20luiroh
[r=allenap][bug=1449396][author=mpontillo] Fix for bug #1449396: Don't try to perform power queries on non-installable nodes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1871
1871
        self.assertResponseCode(httplib.SERVICE_UNAVAILABLE, response)
1872
1872
        self.assertIn(error_message, response.content)
1873
1873
 
 
1874
    def test__returns_400_if_device(self):
 
1875
        device = factory.make_Device()
 
1876
        response = self.client.get(
 
1877
            self.get_node_uri(device), {"op": "query_power_state"})
 
1878
        self.assertResponseCode(httplib.BAD_REQUEST, response)
 
1879
 
1874
1880
    def test__returns_actual_state(self):
1875
1881
        node = factory.make_Node(power_type="ipmi")
1876
1882
        random_state = random.choice(["on", "off", "error"])