Ejemplo n.º 1
0
def test_extra_args():
    cookie_dict = ALL_ARGS.copy()
    cookie_dict["class_name"] = "seleniumLibary"
    cookie = CookieInformation(**cookie_dict)
    assert cookie.name == "foo"
    assert cookie.value == "123"
    assert cookie.extra == {"class_name": "seleniumLibary"}
    string = str(cookie)
    assert "\nextra={'class_name': 'seleniumLibary'}" in string
Ejemplo n.º 2
0
 def test_extra_args(self):
     cookie_dict = self.all_args.copy()
     cookie_dict['class_name'] = 'seleniumLibary'
     cookie = CookieInformation(**cookie_dict)
     self.assertEqual(cookie.name, 'foo')
     self.assertEqual(cookie.value, '123')
     self.assertEqual(cookie.extra, {'class_name': 'seleniumLibary'})
     string = str(cookie)
     self.assertIn("extra={'class_name': 'seleniumLibary'}", string)
Ejemplo n.º 3
0
def test_extra_args():
    cookie_dict = ALL_ARGS.copy()
    cookie_dict['class_name'] = 'seleniumLibary'
    cookie = CookieInformation(**cookie_dict)
    assert cookie.name == 'foo'
    assert cookie.value == '123'
    assert cookie.extra  == {'class_name': 'seleniumLibary'}
    string = str(cookie)
    assert "\nextra={'class_name': 'seleniumLibary'}" in string
Ejemplo n.º 4
0
 def test_all_args(self):
     cookie = CookieInformation(**self.all_args)
     self.assertEqual(cookie.name, 'foo')
     self.assertEqual(cookie.value, '123')
     self.assertEqual(cookie.path, '/')
     self.assertEqual(cookie.domain, 'not.Here')
     self.assertEqual(cookie.secure, True)
     self.assertEqual(cookie.httpOnly, True)
     self.assertEqual(cookie.expiry, datetime.fromtimestamp(123))
     self.assertEqual(cookie.extra, {})
Ejemplo n.º 5
0
def test_all_args():
    cookie = CookieInformation(**ALL_ARGS)
    assert cookie.name == "foo"
    assert cookie.value == "123"
    assert cookie.path == "/"
    assert cookie.domain == "not.Here"
    assert cookie.secure is True
    assert cookie.httpOnly is True
    assert cookie.expiry == datetime.fromtimestamp(123)
    assert cookie.extra == {}
Ejemplo n.º 6
0
def test_all_args():
    cookie = CookieInformation(**ALL_ARGS)
    assert cookie.name == 'foo'
    assert cookie.value == '123'
    assert cookie.path == '/'
    assert cookie.domain == 'not.Here'
    assert cookie.secure == True
    assert cookie.httpOnly == True
    assert cookie.expiry == datetime.fromtimestamp(123)
    assert cookie.extra == {}
Ejemplo n.º 7
0
 def test_name_value_only(self):
     cookie = CookieInformation(name='foo', value='bar')
     self.assertEqual(cookie.name, 'foo')
     self.assertEqual(cookie.value, 'bar')
Ejemplo n.º 8
0
 def test_no_mandatory_args(self):
     cookie_dict = self.all_args.copy()
     del cookie_dict['name']
     with self.assertRaises(TypeError):
         CookieInformation(**cookie_dict)
Ejemplo n.º 9
0
def test_name_value_only():
    cookie = CookieInformation(name="foo", value="bar")
    assert cookie.name == "foo"
    assert cookie.value == "bar"
Ejemplo n.º 10
0
def test_no_mandatory_args():
    cookie_dict = ALL_ARGS.copy()
    del cookie_dict["name"]
    with pytest.raises(TypeError):
        CookieInformation(**cookie_dict)
Ejemplo n.º 11
0
def test_name_value_only():
    cookie = CookieInformation(name='foo', value='bar')
    assert cookie.name == 'foo'
    assert cookie.value == 'bar'