def it_returns_an_image_otherwise(mock_send_file, mock_track):

        display("my_title", "my_path")

        expect(mock_track.mock_calls) == [
            call("my_title"),
        ]
        expect(mock_send_file.mock_calls) == [
            call("my_path", mimetype='image/jpeg'),
        ]
예제 #2
0
    def it_returns_an_image_otherwise(mock_send_file, mock_track):

        display("my_title", "my_path")

        expect(mock_track.mock_calls) == [
            call("my_title"),
        ]
        expect(mock_send_file.mock_calls) == [
            call("my_path", mimetype='image/jpeg'),
        ]
    def it_returns_html_for_browsers(app):

        with app.test_request_context():
            html = display("my_title", "my_path", raw=True)

        print(html)
        assert "<title>my_title</title>" in html
        assert 'url("it\'s a path?alt=style")' in html
        assert "ga('create', 'my_tid', 'auto');" in html
예제 #4
0
    def it_returns_html_for_browsers(app):

        with app.test_request_context():
            html = display("my_title", "my_path", raw=True)

        print(html)
        assert "<title>my_title</title>" in html
        assert 'url("it\'s a path?alt=style")' in html
        assert "ga('create', 'my_tid', 'auto');" in html