Esempio n. 1
0
    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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 def test_default_config(self):
     config = webracer.Config()
     assert config.host is None
Esempio n. 4
0
 def test_bogus_constructor_keyword(self):
     config = webracer.Config(bogus='foo')
Esempio n. 5
0
 def test_constructor_keywords(self):
     config = webracer.Config(host='testhost', port=1234)
     self.assertEqual('testhost', config.host)
     self.assertEqual(1234, config.port)
Esempio n. 6
0
    def test_modifying_config(self):
        config = webracer.Config()
        assert config.host is None

        config.host = 'testhost'
        self.assertEqual('testhost', config.host)