File: __init__.py

package info (click to toggle)
awscli 2.31.35-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156,692 kB
  • sloc: python: 213,816; xml: 14,082; makefile: 189; sh: 178; javascript: 8
file content (24 lines) | stat: -rw-r--r-- 865 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from awscli.customizations.codeartifact import (
    inject_commands,
    register_codeartifact_commands,
)
from awscli.customizations.codeartifact.login import CodeArtifactLogin
from awscli.testutils import mock, unittest


class TestRegisterCodeArtifactCommands(unittest.TestCase):
    def test_register_codeartifact_commands(self):
        event_emitter = mock.Mock()
        register_codeartifact_commands(event_emitter)
        event_emitter.register.assert_called_once_with(
            'building-command-table.codeartifact', inject_commands
        )


class TestInjectCommands(unittest.TestCase):
    def test_inject_commands(self):
        command_table = {}
        session = mock.Mock()
        inject_commands(command_table, session)
        self.assertIn('login', command_table)
        self.assertIsInstance(command_table['login'], CodeArtifactLogin)