Add more tests for config list
@@ -8,7 +8,22 @@ from polyaxon_cli.cli.config import config
class TestConfigManager(BaseCommandTestCase):
+ @patch('polyaxon_cli.managers.config.GlobalConfigManager.is_initialized')
+ def test_config_list_checks_initialized(self, is_initialized):
+ is_initialized.return_value = False
+ self.runner.invoke(config, ['--list'])
+ assert is_initialized.call_count == 1
+
+ @patch('polyaxon_cli.managers.config.GlobalConfigManager.is_initialized')
+ @patch('polyaxon_cli.managers.config.GlobalConfigManager.CONFIG')
+ def test_config_list_gets_default_config(self, default_config, is_initialized):
+ is_initialized.return_value = False
+ self.runner.invoke(config, ['--list'])
+ assert default_config.call_count == 1
+
+ @patch('polyaxon_cli.managers.config.GlobalConfigManager.is_initialized')
@patch('polyaxon_cli.managers.config.GlobalConfigManager.get_config')
- def test_config_list(self, get_user):
+ def test_config_list_gets_file_config(self, get_config, is_initialized):
+ is_initialized.return_value = True
self.runner.invoke(config, ['--list'])
- assert get_user.call_count == 1
+ assert get_config.call_count == 1
