File: test_globals.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-- 807 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
import os
import unittest

from awscli.clidocs import (
    GLOBAL_OPTIONS_FILE,
    GLOBAL_OPTIONS_SYNOPSIS_FILE,
    GlobalOptionsDocumenter,
)
from awscli.testutils import create_clidriver


class TestGlobalOptionsDocumenter(unittest.TestCase):
    def setUp(self):
        self.driver = create_clidriver()
        self.help_command = self.driver.create_help_command()
        self.globals = GlobalOptionsDocumenter(self.help_command)

    def test_doc_global_options_match_saved_content(self):
        with open(GLOBAL_OPTIONS_FILE) as f:
            self.assertEqual(self.globals.doc_global_options(), f.read())

    def test_doc_global_synopsis_match_saved_content(self):
        with open(GLOBAL_OPTIONS_SYNOPSIS_FILE) as f:
            self.assertEqual(self.globals.doc_global_synopsis(), f.read())