def test_configure_with_file_validation_success(self, mock_open): with mock.patch('os.path.isfile', return_value=True): settings = Settings() settings.configure(settings_path='robottelo.properties') assert settings.configured assert settings.server.hostname == 'example.com' assert settings.server.ssh_password == '1234'
def test_configure_validation_success(self, mock_open): with mock.patch('os.path.isfile', return_value=True): settings = Settings() settings.configure() self.assertTrue(settings.configured) self.assertEqual(settings.server.hostname, 'example.com') self.assertEqual(settings.server.ssh_password, '1234')
def test_configure_validation_error(self, mock_open): settings = Settings() with pytest.raises(ImproperlyConfigured): settings.configure()
from robottelo.config.base import Settings #: A :class:`Settings` object. settings = Settings()