Skip to content

Commit

Permalink
Merge pull request #183 from larsks/fix/uuid-warnings
Browse files Browse the repository at this point in the history
Eliminate test warnings due to invalid uuids
  • Loading branch information
tzumainn authored Feb 10, 2025
2 parents 7aea000 + fe10fb4 commit 322a0c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions esi_leap/tests/api/controllers/v1/test_console_auth_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import http.client as http_client
import mock
import uuid
from oslo_utils import uuidutils

from esi_leap.common import ironic
Expand All @@ -28,6 +29,7 @@ def setUp(self):
)
@mock.patch.object(ironic, "get_ironic_client", autospec=True)
def test_post(self, mock_client, mock_authorize):
mock_client.return_value.node.get.return_value = mock.Mock(uuid=uuid.uuid4())
mock_authorize.return_value = "fake-token"

data = {"node_uuid_or_name": self.node_uuid, "token_ttl": "10"}
Expand Down
7 changes: 4 additions & 3 deletions esi_leap/tests/objects/test_console_auth_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from datetime import datetime
import mock
import uuid

from oslo_db.exception import DBDuplicateEntry
from oslo_utils import uuidutils
Expand All @@ -31,7 +32,7 @@ def setUp(self):

self.test_cat_dict = {
"id": 1,
"node_uuid": "test-node",
"node_uuid": str(uuid.uuid4()),
"token": self.token,
"expires": 1,
"created_at": self.created_at,
Expand All @@ -40,15 +41,15 @@ def setUp(self):

self.test_authorized_cat_dict = {
"id": 1,
"node_uuid": "test-node",
"node_uuid": str(uuid.uuid4()),
"token_hash": self.token_hash,
"expires": 1,
"created_at": self.created_at,
"updated_at": None,
}

self.test_unauthorized_cat_dict = {
"node_uuid": "test-node",
"node_uuid": str(uuid.uuid4()),
"token": self.token,
"expires": 1,
"created_at": self.created_at,
Expand Down

0 comments on commit 322a0c2

Please sign in to comment.