Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/tests/unit/customizations/codeartifact/__init__.py
2637 views
1
from awscli.testutils import unittest
2
from awscli.testutils import mock
3
from awscli.customizations.codeartifact import register_codeartifact_commands
4
from awscli.customizations.codeartifact import inject_commands
5
from awscli.customizations.codeartifact.login import CodeArtifactLogin
6
7
8
class TestRegisterCodeArtifactCommands(unittest.TestCase):
9
def test_register_codeartifact_commands(self):
10
event_emitter = mock.Mock()
11
register_codeartifact_commands(event_emitter)
12
event_emitter.register.assert_called_once_with(
13
'building-command-table.codeartifact', inject_commands
14
)
15
16
17
class TestInjectCommands(unittest.TestCase):
18
def test_inject_commands(self):
19
command_table = {}
20
session = mock.Mock()
21
inject_commands(command_table, session)
22
self.assertIn('login', command_table)
23
self.assertIsInstance(
24
command_table['login'], CodeArtifactLogin
25
)
26
27