Exemplo n.º 1
0
 def test_get_user_agent(self):
     req = EobotRequest()
     self.assertEqual(
         'RickDenHaan-Eobot/{0} (+http://github.com/rickdenhaan/eobot-py)'.
         format(__version__), req.get_user_agent())
     req.set_user_agent("UserAgent")
     self.assertEqual("UserAgent", req.get_user_agent())
Exemplo n.º 2
0
    def test_set_user_agent_with_invalid_value(self):
        req = EobotRequest()

        with self.assertRaises(ValueError):
            # noinspection PyTypeChecker
            req.set_user_agent(123)
Exemplo n.º 3
0
 def test_set_user_agent_with_str(self):
     req = EobotRequest()
     req.set_user_agent("UserAgent")
     self.assertEqual("UserAgent", req._user_agent)
Exemplo n.º 4
0
    def test_set_user_agent_without_value(self):
        req = EobotRequest()

        with self.assertRaises(TypeError):
            # noinspection PyArgumentList
            req.set_user_agent()