def test_full_email(self): 'An email addresses should be followed by a semicolon.' params = { 'from': 'https://foo', 'status_code': 303, 'to': 'bar', 'email': '*****@*****.**', } conf = app.nginx_conf(params) n.assert_in('[email protected];', conf)
def test_empty_email(self): 'An empty email should still create a line' params = { 'from': 'https://foo', 'status_code': 303, 'to': 'bar', 'email': '', } conf = app.nginx_conf(params) n.assert_in('# email', conf)
def test_add_http(self): '"http://" should be added to "to" if it\'s missing' params = { 'from': 'foo', 'status_code': 303, 'to': 'bar', 'email': '', } conf = app.nginx_conf(params) n.assert_in('http://bar$request_uri;', conf)
def test_remove_https(self): '"https://" should be removed from "from" if it\'s in there' params = { 'from': 'https://foo', 'status_code': 303, 'to': 'bar', 'email': '', } conf = app.nginx_conf(params) n.assert_not_in('https://foo', conf) n.assert_in('foo', conf)