Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return expires_on from get-access-token #27410

Closed
wants to merge 1 commit into from

return expires_on from get-access-token

9bbb540
Select commit
Loading
Failed to load commit list.
Closed

return expires_on from get-access-token #27410

return expires_on from get-access-token
9bbb540
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Azure.azure-cli Full Test failed Sep 17, 2023 in 20m 2s

Build #20230917.10 had test failures

Details

Tests

  • Failed: 2 (0.02%)
  • Passed: 10,392 (89.90%)
  • Other: 1,165 (10.08%)
  • Total: 11,559

Annotations

Check failure on line 1442 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-cli Full Test

Build log #L1442

Bash exited with code '1'.

Check failure on line 1445 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-cli Full Test

Build log #L1445

Bash exited with code '1'.

Check failure on line 1 in test_get_raw_token

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-cli Full Test

test_get_raw_token

self = <azure.cli.command_modules.profile.tests.latest.test_profile_custom.ProfileCommandTest testMethod=test_get_raw_token>
get_raw_token_mock = <function get_raw_token at 0x7feb3c208310>

    @mock.patch('azure.cli.core._profile.Profile.get_raw_token', autospec=True)
    def test_get_raw_token(self, get_raw_token_mock):
        cmd = mock.MagicMock()
        cmd.cli_ctx = DummyCli()
    
        get_raw_token_mock.return_value = (['bearer', 'token123', {'expiresOn': '2100-01-01'}], 'sub123', 'tenant123')
    
        result = get_access_token(cmd)
    
        # assert
        get_raw_token_mock.assert_called_with(mock.ANY, None, None, None, None)
        expected_result = {
            'tokenType': 'bearer',
            'accessToken': 'token123',
            'expiresOn': '2100-01-01',
            'subscription': 'sub123',
            'tenant': 'tenant123'
        }
>       self.assertEqual(result, expected_result)
E       AssertionError: {'tok[49 chars]pires_on': None, 'expiresOn': '2100-01-01', 't[41 chars]123'} != {'tok[49 chars]piresOn': '2100-01-01', 'subscription': 'sub12[21 chars]123'}
E         {'accessToken': 'token123',
E          'expiresOn': '2100-01-01',
E       -  'expires_on': None,
E          'subscription': 'sub123',
E          'tenant': 'tenant123',
E          'tokenType': 'bearer'}

src/azure-cli/azure/cli/command_modules/profile/tests/latest/test_profile_custom.py:53: AssertionError
Raw output
self = <azure.cli.command_modules.profile.tests.latest.test_profile_custom.ProfileCommandTest testMethod=test_get_raw_token>
get_raw_token_mock = <function get_raw_token at 0x7feb3c208310>

    @mock.patch('azure.cli.core._profile.Profile.get_raw_token', autospec=True)
    def test_get_raw_token(self, get_raw_token_mock):
        cmd = mock.MagicMock()
        cmd.cli_ctx = DummyCli()
    
        get_raw_token_mock.return_value = (['bearer', 'token123', {'expiresOn': '2100-01-01'}], 'sub123', 'tenant123')
    
        result = get_access_token(cmd)
    
        # assert
        get_raw_token_mock.assert_called_with(mock.ANY, None, None, None, None)
        expected_result = {
            'tokenType': 'bearer',
            'accessToken': 'token123',
            'expiresOn': '2100-01-01',
            'subscription': 'sub123',
            'tenant': 'tenant123'
        }
>       self.assertEqual(result, expected_result)
E       AssertionError: {'tok[49 chars]pires_on': None, 'expiresOn': '2100-01-01', 't[41 chars]123'} != {'tok[49 chars]piresOn': '2100-01-01', 'subscription': 'sub12[21 chars]123'}
E         {'accessToken': 'token123',
E          'expiresOn': '2100-01-01',
E       -  'expires_on': None,
E          'subscription': 'sub123',
E          'tenant': 'tenant123',
E          'tokenType': 'bearer'}

src/azure-cli/azure/cli/command_modules/profile/tests/latest/test_profile_custom.py:53: AssertionError

Check failure on line 1 in test_get_raw_token

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-cli Full Test

test_get_raw_token

self = <azure.cli.command_modules.profile.tests.latest.test_profile_custom.ProfileCommandTest testMethod=test_get_raw_token>
get_raw_token_mock = <function get_raw_token at 0x7f0029257b80>

    @mock.patch('azure.cli.core._profile.Profile.get_raw_token', autospec=True)
    def test_get_raw_token(self, get_raw_token_mock):
        cmd = mock.MagicMock()
        cmd.cli_ctx = DummyCli()
    
        get_raw_token_mock.return_value = (['bearer', 'token123', {'expiresOn': '2100-01-01'}], 'sub123', 'tenant123')
    
        result = get_access_token(cmd)
    
        # assert
        get_raw_token_mock.assert_called_with(mock.ANY, None, None, None, None)
        expected_result = {
            'tokenType': 'bearer',
            'accessToken': 'token123',
            'expiresOn': '2100-01-01',
            'subscription': 'sub123',
            'tenant': 'tenant123'
        }
>       self.assertEqual(result, expected_result)
E       AssertionError: {'tok[49 chars]pires_on': None, 'expiresOn': '2100-01-01', 't[41 chars]123'} != {'tok[49 chars]piresOn': '2100-01-01', 'subscription': 'sub12[21 chars]123'}
E         {'accessToken': 'token123',
E          'expiresOn': '2100-01-01',
E       -  'expires_on': None,
E          'subscription': 'sub123',
E          'tenant': 'tenant123',
E          'tokenType': 'bearer'}

src/azure-cli/azure/cli/command_modules/profile/tests/latest/test_profile_custom.py:53: AssertionError
Raw output
self = <azure.cli.command_modules.profile.tests.latest.test_profile_custom.ProfileCommandTest testMethod=test_get_raw_token>
get_raw_token_mock = <function get_raw_token at 0x7f0029257b80>

    @mock.patch('azure.cli.core._profile.Profile.get_raw_token', autospec=True)
    def test_get_raw_token(self, get_raw_token_mock):
        cmd = mock.MagicMock()
        cmd.cli_ctx = DummyCli()
    
        get_raw_token_mock.return_value = (['bearer', 'token123', {'expiresOn': '2100-01-01'}], 'sub123', 'tenant123')
    
        result = get_access_token(cmd)
    
        # assert
        get_raw_token_mock.assert_called_with(mock.ANY, None, None, None, None)
        expected_result = {
            'tokenType': 'bearer',
            'accessToken': 'token123',
            'expiresOn': '2100-01-01',
            'subscription': 'sub123',
            'tenant': 'tenant123'
        }
>       self.assertEqual(result, expected_result)
E       AssertionError: {'tok[49 chars]pires_on': None, 'expiresOn': '2100-01-01', 't[41 chars]123'} != {'tok[49 chars]piresOn': '2100-01-01', 'subscription': 'sub12[21 chars]123'}
E         {'accessToken': 'token123',
E          'expiresOn': '2100-01-01',
E       -  'expires_on': None,
E          'subscription': 'sub123',
E          'tenant': 'tenant123',
E          'tokenType': 'bearer'}

src/azure-cli/azure/cli/command_modules/profile/tests/latest/test_profile_custom.py:53: AssertionError