def setup(self): super(TestNoveListAPI, self).setup() with temp_config() as config: config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PROFILE: "library", Configuration.NOVELIST_PASSWORD: "******" } self.novelist = NoveListAPI.from_config(self._db)
def setup(self): super(TestNoveListAPI, self).setup() self.integration = self._external_integration( ExternalIntegration.NOVELIST, ExternalIntegration.METADATA_GOAL, username=u'library', password=u'yep', libraries=[self._default_library] ) self.novelist = NoveListAPI.from_config(self._default_library)
def setup(self): super(TestNoveListAPI, self).setup() with temp_config() as config: config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PROFILE : "library", Configuration.NOVELIST_PASSWORD : "******" } self.novelist = NoveListAPI.from_config(self._db)
def setup(self): super(TestNoveListAPI, self).setup() self.integration = self._external_integration( ExternalIntegration.NOVELIST, ExternalIntegration.METADATA_GOAL, username=u'library', password=u'yep', libraries=[self._default_library], ) self.novelist = NoveListAPI.from_config(self._default_library)
def setup_method(self): super(TestNoveListAPI, self).setup_method() self.integration = self._external_integration( ExternalIntegration.NOVELIST, ExternalIntegration.METADATA_GOAL, username="******", password="******", libraries=[self._default_library], ) self.novelist = NoveListAPI.from_config(self._default_library)
def test_from_config(self): """Confirms that NoveListAPI can be built from config successfully""" novelist = NoveListAPI.from_config(self._default_library) eq_(True, isinstance(novelist, NoveListAPI)) eq_("library", novelist.profile) eq_("yep", novelist.password) # Without either configuration value, an error is raised. self.integration.password = None assert_raises(ValueError, NoveListAPI.from_config, self._default_library) self.integration.password = u'yep' self.integration.username = None assert_raises(ValueError, NoveListAPI.from_config, self._default_library)
def test_from_config(self): """Confirms that NoveListAPI can be built from config successfully""" novelist = NoveListAPI.from_config(self._default_library) eq_(True, isinstance(novelist, NoveListAPI)) eq_("library", novelist.profile) eq_("yep", novelist.password) # Without either configuration value, an error is raised. self.integration.password = None assert_raises(CannotLoadConfiguration, NoveListAPI.from_config, self._default_library) self.integration.password = u'yep' self.integration.username = None assert_raises(CannotLoadConfiguration, NoveListAPI.from_config, self._default_library)
def test_from_config(self): """Confirms that NoveListAPI can be built from config successfully""" novelist = NoveListAPI.from_config(self._default_library) assert True == isinstance(novelist, NoveListAPI) assert "library" == novelist.profile assert "yep" == novelist.password # Without either configuration value, an error is raised. self.integration.password = None pytest.raises( CannotLoadConfiguration, NoveListAPI.from_config, self._default_library ) self.integration.password = "******" self.integration.username = None pytest.raises( CannotLoadConfiguration, NoveListAPI.from_config, self._default_library )
def test_from_config(self): """Confirms that NoveListAPI can be built from config successfully""" with temp_config() as config: config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PROFILE: "library", Configuration.NOVELIST_PASSWORD: "******" } novelist = NoveListAPI.from_config(self._db) eq_(True, isinstance(novelist, NoveListAPI)) eq_("library", novelist.profile) eq_("yep", novelist.password) # Without either configuration value, an error is raised. config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PROFILE: "library" } assert_raises(ValueError, NoveListAPI.from_config, self._db) config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PASSWORD: "******" } assert_raises(ValueError, NoveListAPI.from_config, self._db)
def test_from_config(self): """Confirms that NoveListAPI can be built from config successfully""" with temp_config() as config: config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PROFILE : "library", Configuration.NOVELIST_PASSWORD : "******" } novelist = NoveListAPI.from_config(self._db) eq_(True, isinstance(novelist, NoveListAPI)) eq_("library", novelist.profile) eq_("yep", novelist.password) # Without either configuration value, an error is raised. config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PROFILE : "library" } assert_raises(ValueError, NoveListAPI.from_config, self._db) config['integrations'][Configuration.NOVELIST_INTEGRATION] = { Configuration.NOVELIST_PASSWORD : "******" } assert_raises(ValueError, NoveListAPI.from_config, self._db)