Debian Codegraph @

test/units/test_context.py

raw
1 # -*- coding: utf-8 -*-
2 # Copyright: (c) 2018, Toshio Kuratomi <[email protected]>
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 from __future__ import annotations
6
7 from ansible import context
8
9
10 class FakeOptions:
11 pass
12
13
14 def test_set_global_context():
15 options = FakeOptions()
16 options.tags = [u'production', u'webservers']
17 options.check_mode = True
18 options.start_at_task = u'Start with くらとみ'
19
20 expected = frozenset((('tags', (u'production', u'webservers')),
21 ('check_mode', True),
22 ('start_at_task', u'Start with くらとみ')))
23
24 context._init_global_context(options)
25 assert frozenset(context.CLIARGS.items()) == expected