示例#1
0
文件: auth.py 项目: razaaliraza/hil
 def test_show_networking_action_admin(self):
     """Test that admins can get status"""
     self.auth_backend.set_project(self.runway)
     self.auth_backend.set_admin(True)
     response = json.loads(api.show_networking_action(self.status_id))
     assert response == {'status': 'PENDING',
                         'node': 'manhattan_node_0',
                         'nic': 'boot-nic',
                         'type': 'modify_port',
                         'channel': 'null',
                         'new_network': 'stock_int_pub'}
示例#2
0
文件: auth.py 项目: SahilTikale/hil
 def test_show_networking_action_admin(self):
     """Test that admins can get status"""
     self.auth_backend.set_project(self.runway)
     self.auth_backend.set_admin(True)
     response = json.loads(api.show_networking_action(self.status_id))
     assert response == {'status': 'PENDING',
                         'node': 'manhattan_node_0',
                         'nic': 'boot-nic',
                         'type': 'modify_port',
                         'channel': 'null',
                         'new_network': 'stock_int_pub'}
示例#3
0
文件: auth.py 项目: razaaliraza/hil
    def test_show_networking_action_success(self):
        """Test that project that has access to the node can run
        show_networking_action"""

        self.auth_backend.set_project(self.manhattan)
        response = json.loads(api.show_networking_action(self.status_id))
        assert response == {'status': 'PENDING',
                            'node': 'manhattan_node_0',
                            'nic': 'boot-nic',
                            'type': 'modify_port',
                            'channel': 'null',
                            'new_network': 'stock_int_pub'}
示例#4
0
文件: auth.py 项目: SahilTikale/hil
    def test_show_networking_action_success(self):
        """Test that project that has access to the node can run
        show_networking_action"""

        self.auth_backend.set_project(self.manhattan)
        response = json.loads(api.show_networking_action(self.status_id))
        assert response == {'status': 'PENDING',
                            'node': 'manhattan_node_0',
                            'nic': 'boot-nic',
                            'type': 'modify_port',
                            'channel': 'null',
                            'new_network': 'stock_int_pub'}
示例#5
0
文件: auth.py 项目: razaaliraza/hil
    def test_show_networking_action_failure(self):
        """Test that project with no access to node can't get the status"""
        self.auth_backend.set_project(self.runway)

        with pytest.raises(AuthorizationError):
            api.show_networking_action(self.status_id)
示例#6
0
文件: auth.py 项目: SahilTikale/hil
    def test_show_networking_action_failure(self):
        """Test that project with no access to node can't get the status"""
        self.auth_backend.set_project(self.runway)

        with pytest.raises(AuthorizationError):
            api.show_networking_action(self.status_id)