def test_user_agent(self): """User-Agent should be properly set""" self.d.artist(1).name bad_client = Client('') self.assertRaises(ConfigurationError, lambda: bad_client.artist(1).name) try: bad_client.artist(1).name except ConfigurationError as e: self.assertTrue('User-Agent' in str(e))
def test_user_agent(self): """User-Agent should be properly set""" self.d.artist(1).name bad_client = Client('') self.assertRaises(ConfigurationError, lambda: bad_client.artist(1).name) try: bad_client.artist(1).name except ConfigurationError as e: self.assertTrue('User-Agent' in str(e))
def test_user_agent(file_client): """User-Agent should be properly set""" file_client.artist(1).name bad_client = Client('') with pytest.raises(ConfigurationError): bad_client.artist(1).name try: bad_client.artist(1).name except ConfigurationError as e: assert 'User-Agent' in str(e)