コード例 #1
0
 def test_create_wikipage(self, mock_new_resource):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     mock_new_resource.return_value = WikiPage(rm)
     WikiPages(rm).create(1, 'WikiPage-Slug', 'Some content')
     mock_new_resource.assert_called_with(
         payload={'project': 1, 'slug': 'WikiPage-Slug', 'content': 'Some content'}
     )
コード例 #2
0
 def test_create_wikipage(self, mock_new_resource):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     mock_new_resource.return_value = WikiPage(rm)
     WikiPages(rm).create(1, "WikiPage-Slug", "Some content")
     mock_new_resource.assert_called_with(payload={
         "project": 1,
         "slug": "WikiPage-Slug",
         "content": "Some content"
     })
コード例 #3
0
 def test_import_wikipage(self, mock_requestmaker_post):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     WikiPages(rm).import_(1, 'WikiPage-Slug', 'Some content')
     mock_requestmaker_post.assert_called_with(
         '/{endpoint}/{id}/{type}', endpoint='importer', payload={
             'project': 1, 'content': 'Some content', 'slug': 'WikiPage-Slug'
         },
         id=1, type='wiki_page'
     )
コード例 #4
0
 def test_import_wikipage(self, mock_requestmaker_post):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     WikiPages(rm).import_(1, "WikiPage-Slug", "Some content")
     mock_requestmaker_post.assert_called_with(
         "/{endpoint}/{id}/{type}",
         endpoint="importer",
         payload={
             "project": 1,
             "content": "Some content",
             "slug": "WikiPage-Slug"
         },
         id=1,
         type="wiki_page",
     )