def test_constructor_copy(self): config = webracer.Config() assert config.host is None config.host = 'testhost' copy = webracer.Config(config) self.assertEqual('testhost', copy.host) copy = webracer.Config(config, host='foobar') self.assertEqual('foobar', copy.host)
def test_current_url_after_following_redirect(self): s = webracer.Agent(webracer.Config(follow_redirects=True, **base_config)) s.get('/redirect') self.assertEqual('http://localhost:8052/found', s.current_url)
def test_default_config(self): config = webracer.Config() assert config.host is None
def test_bogus_constructor_keyword(self): config = webracer.Config(bogus='foo')
def test_constructor_keywords(self): config = webracer.Config(host='testhost', port=1234) self.assertEqual('testhost', config.host) self.assertEqual(1234, config.port)
def test_modifying_config(self): config = webracer.Config() assert config.host is None config.host = 'testhost' self.assertEqual('testhost', config.host)