# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (C) Jupyter Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. # ----------------------------------------------------------------------------- import requests from ....tests.base import FormatHTMLMixin from ....tests.base import NBViewerTestCase from ....tests.base import skip_unless_github_auth class GistTestCase(NBViewerTestCase): @skip_unless_github_auth def test_gist(self): url = self.url("2352771") r = requests.get(url) self.assertEqual(r.status_code, 200) @skip_unless_github_auth def test_gist_not_nb(self): url = self.url("6689377") r = requests.get(url) self.assertEqual(r.status_code, 400) @skip_unless_github_auth def test_gist_no_such_file(self): url = self.url("6689377/no/file.ipynb") r = requests.get(url) self.assertEqual(r.status_code, 404) @skip_unless_github_auth def test_gist_list(self): url = self.url("7518294") r = requests.get(url) self.assertEqual(r.status_code, 200) html = r.text self.assertIn("