-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathtest_format.py
More file actions
36 lines (30 loc) · 1.43 KB
/
test_format.py
File metadata and controls
36 lines (30 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
import configparser
import unittest
from unittest import mock
class TestConfigFilePath(unittest.TestCase):
def test_black_config_without_setup(self):
mocked_config = configparser.ConfigParser()
mocked_config.add_section("cli")
mocked_config.set("cli", "repo_path", "")
mocked_config.add_section("ext")
mocked_config.set("ext", "repo_paths", "")
def test_black_config_with_partially_setup(self):
cli_repo_path = "~/Azure/azure-cli"
mocked_config = configparser.ConfigParser()
mocked_config.add_section("cli")
mocked_config.set("cli", "repo_path", cli_repo_path)
mocked_config.add_section("ext")
mocked_config.set("ext", "repo_paths", "")
def test_black_config_with_all_setup(self):
cli_repo_path = "~/Azure/azure-cli"
ext_repo_path = "~/Azure/azure-cli-extensions"
mocked_config = configparser.ConfigParser()
mocked_config.add_section("cli")
mocked_config.set("cli", "repo_path", cli_repo_path)
mocked_config.add_section("ext")
mocked_config.set("ext", "repo_paths", ext_repo_path)