|
80 | 80 | 'region_name': 'occ-cloud,krikkit,occ-env', |
81 | 81 | 'log_file': '/tmp/test_log_file', |
82 | 82 | 'log_level': 'debug', |
| 83 | + 'cert': 'mycert', |
| 84 | + 'key': 'mickey', |
83 | 85 | } |
84 | 86 | } |
85 | 87 | } |
@@ -562,6 +564,24 @@ def test_shell_args_ca_options(self): |
562 | 564 | self.assertEqual('foo', _shell.options.cacert) |
563 | 565 | self.assertFalse(_shell.verify) |
564 | 566 |
|
| 567 | + def test_shell_args_cert_options(self): |
| 568 | + _shell = make_shell() |
| 569 | + |
| 570 | + # Default |
| 571 | + fake_execute(_shell, "list user") |
| 572 | + self.assertEqual('', _shell.options.cert) |
| 573 | + self.assertEqual('', _shell.options.key) |
| 574 | + |
| 575 | + # --os-cert |
| 576 | + fake_execute(_shell, "--os-cert mycert list user") |
| 577 | + self.assertEqual('mycert', _shell.options.cert) |
| 578 | + self.assertEqual('', _shell.options.key) |
| 579 | + |
| 580 | + # --os-key |
| 581 | + fake_execute(_shell, "--os-key mickey list user") |
| 582 | + self.assertEqual('', _shell.options.cert) |
| 583 | + self.assertEqual('mickey', _shell.options.key) |
| 584 | + |
565 | 585 | def test_default_env(self): |
566 | 586 | flag = "" |
567 | 587 | kwargs = { |
@@ -665,6 +685,9 @@ def test_shell_args_cloud_public(self, config_mock, public_mock): |
665 | 685 | _shell.cloud.config['region_name'], |
666 | 686 | ) |
667 | 687 |
|
| 688 | + self.assertEqual('mycert', _shell.cloud.config['cert']) |
| 689 | + self.assertEqual('mickey', _shell.cloud.config['key']) |
| 690 | + |
668 | 691 | @mock.patch("os_client_config.config.OpenStackConfig._load_vendor_file") |
669 | 692 | @mock.patch("os_client_config.config.OpenStackConfig._load_config_file") |
670 | 693 | def test_shell_args_precedence(self, config_mock, vendor_mock): |
|
0 commit comments