зеркало из
1
0
Форкнуть 0
* Initial commit

* Initial commit

* Initial commit

* wip: initial work - incomplete

* Copy code from https://github.com/Azure/azure-cli/tree/master/src/azure-cli-testsdk

* Add vcrpy version from azure-cli

* Add VSCode ignores

* Add Azure imports

* Start converting CLI commands to SDK calls

* Minor proofreading

* Add required common and mock modules

* Add deps, update pkgs and url

* Package structure

* Add more editor ignores

* Remove azure deps and nonexistent HISTORY ref

* Remove Azure mgmt dependencies

* Remove azure.common dependency

* Add dependency on six

* Remove CLI-specific stuff

* Remove CLI exception

* Remove most CLI-centric patches

* Remove older CLI-centric base class

* Add sleep patch back in

* First steps toward a unified config

* Config and no-record headers

Add config object to ScenarioTest
Add fake header for deactivating recording
Align cmdline options with vcr.py options

* Move recording-deactivation header detection to right place

* Add way to set default config file from scenario test

* Remove 'CLI' from env vars

* Reinstate patch_long_run_operation_delay

* New record disabling mechanism

* Modify config options for better backwards compatibility

* Ignore more VS stuff

* Remove jmespath dependency, update vcrpy

* Remove checkers

* Remove unuseds, make patches/processors kwargs

* Remove checkers, used only for CLI

* Update import and instance var name

* Remove unused imports

* line organization

* Update version number and vcrpy version

* Add a little more to README, add setup.cfg

* Add unit tests for TestConfig

* Add travis.yml and update dependencies

* Update author email

* Dummy push to try to trigger a Travis build

* Another dummy commit for Travis

* Switch to README.rst

* Update Travis tag pointer

* Use io to get encoding arg when reading README

* Remove unnecessary import

* Expose most everything in top-level namespace

* ScenarioTest -> ReplayableTest; update version

* Update version

* Remove unused os.path import

* Fix super call

* Fix super call in setUp

* Update ReplayableTest import

* Use earlier vcrpy, update version num

* Don't fix vcrpy version

* Drop "cli" from default random name prefix

* Add deployment to Travis

* Specify universal wheel

* Bump version to 0.2.2 for testing CI release process

* Let preparer subclasses override create_random_name

* De-"privatize" mock_in_unit_test and expose it

* Bump version to 0.3.0

* Set disable_recording from kwarg

* Don't treat mock_in_unit_test as a unittest

* Remove skip for mock_in_unit_test, specify test dir

* Update version numbers

* Remove extraneous requirements

* Remove outdated README.md stuff

* Update install for new requirements.txt

* Add 3.6-dev to pythons

* Update code style and run pylint in Travis

* Integrate with codecov.io

* Add test cover IntegrationTestBase

Also check in IntelliJ IDEA workspace configuration just in case someone
else is using PyCharm

* Add test case for LiveTest constructor

* Add tests cover create_random_name

* Add test covering get_sha1_hash

* Add test cover RecordingProcessor base class

* Add test covering SubscriptionRecordingProcessor

* Configure code coverage using configuration file

* Use unittest instead of nosetests to drive the automation

* Fix a few code style issues

* Rename coveragerc file

* Add AccessTokenProcessor

* Split intro and overview into clauses

* Back to paragraphs

* Update intro, add vcr link

* Update intro paragraph to be more general

* Remove reference to command modules

* Update test and module refs; clarify VCR.py role

* Remove outdated reference to class with builtin preparer

* Replace intro text

Use intro stolen from defunct recording_vcr_tests.md

* s/ScenarioTest/ReplayableTest/

* Add note about semantic linefeeds

* Make semantic linefeeds note an HTML comment

* Remove CLI examples and add links to consumers

* Remove doc for legacy test case class

* Finish sentence

* Add subclass kwarg information

* Fix subscription ID removal and test new cases

* Fix no-self-use linter complaint

* Downgrade the version of vcrpy dependency

from 1.11.1 to 1.11.0 due to a sympton similar to this
https://github.com/kevin1024/vcrpy/issues/318

* Bump version to 0.5.0 to prepare for release

* Fix import on Py3 not-TravisCI

* Fix recordmode

* Tight config test

* url parsing fix

* fixed pylint import order

* pylint import fix

* added record processor for slashes

* changed processor name

* Bump version 0.5.0 => 0.5.1

* Fix SubscriptionIdReplacer

* Update version 0.5.1 => 0.5.2

* Update __init__.py

* Detect leaked LRO poller

* PyLint happiness

* Improve error message

* wip

* fix error

* use base 64

* simplify

* add comments

* fix tests

* fix lint error

* use newer pylint to avoid invalid line errors

* add a new test

* address review feedback

* address review feedback

* support large response payload

* remove useless single quots from the error message

* setup: update version

* do not use preparer model for allowing large payload

* address review feedback

* Support Autorest.Python 3.x LRO leak (#42)

* Support Autorest.Python 3.x LRO leak

* PyLint happyness

* Bump version to 0.5.5

* Update the resource removal sequence

Also:
1. Adopt py.test over nosetest
2. Cleanup some test code

* remove x-ms-authorization-auxiliary header

* fix lint error

* update version

* Add some CI tools to devtools

* Readme update

* Some tests configuration

* Use Pytest as test launcher

* PyLint fixes

* CI tools tests are Py3.6 only

* PyLint CI tools only if 3.6

* CI tools tests recording

* Dont't Pylint the tests

* Fix incorrect usage of os.environ

* Make tests X-platform valid

* Fix test dependent of traceback

* Robust preparer testing

* PyGithub 1.40

* Release 1.1.0

* Allow clone_to_path to have both PR and SHA1 (#49)

* Allow clone_to_path to have both PR and SHA1

* Fix test

* Update github_tools.py (#55)

* SingleValueReplacer.process_request properly decodes request.body if its type is byte. (#56)

* Remove pointless files

* Move to tools

* Update dev_requirement file

* Don't record requests to AAD OAuth2 v2.0 endpoint

* Use devtools from repo, not from PyPI

* Fix mock dep
This commit is contained in:
Laurent Mazuel 2019-06-10 10:15:46 -07:00 коммит произвёл GitHub
Родитель e4d9945c0e
Коммит 824a5a2477
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
49 изменённых файлов: 3557 добавлений и 5 удалений

Просмотреть файл

@ -74,15 +74,20 @@ content_packages = sorted(
]
)
# Put azure-common in front
if "azure-common" in content_packages:
content_packages.remove("azure-common")
content_packages.insert(0, "azure-common")
# Install tests dep first
if "azure-devtools" in content_packages:
content_packages.remove("azure-devtools")
content_packages.insert(0, "azure-devtools")
if "azure-sdk-tools" in content_packages:
content_packages.remove("azure-sdk-tools")
content_packages.insert(1, "azure-sdk-tools")
# Put azure-common in front of content package
if "azure-common" in content_packages:
content_packages.remove("azure-common")
content_packages.insert(2, "azure-common")
print("Running dev setup...")
print("Root directory '{}'\n".format(root_dir))
@ -100,8 +105,9 @@ if sys.version_info < (3,):
pip_command("install {}/{}/".format(packages[package_name], package_name))
# install packages
print("Packages to install: {}".format(content_packages))
for package_name in content_packages:
print("Installing {}".format(package_name))
print("\nInstalling {}".format(package_name))
# if we are running dev_setup with no arguments. going after dev_requirements will be a pointless exercise
# and waste of cycles as all the dependencies will be installed regardless.
if os.path.isfile(

Просмотреть файл

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

Просмотреть файл

@ -0,0 +1,32 @@
.. image:: https://travis-ci.org/Azure/azure-python-devtools.svg?branch=master
:target: https://travis-ci.org/Azure/azure-python-devtools
Development tools for Python-based Azure tools
==============================================
This package contains tools to aid in developing Python-based Azure code.
This includes the following components:
scenario_tests
--------------
A testing framework to handle much of the busywork
associated with testing code that interacts with Azure.
ci_tools
--------
Some tooling to help developing CI tools. This includes some Git helpers,
Github RestAPI wrapper and a Bot framework for Github issues.
Contributing
============
This project has adopted the
`Microsoft Open Source Code of Conduct <https://opensource.microsoft.com/codeofconduct/>`__.
For more information see the
`Code of Conduct FAQ <https://opensource.microsoft.com/codeofconduct/faq/>`__
or contact
`opencode@microsoft.com <mailto:opencode@microsoft.com>`__
with any additional questions or comments.

Просмотреть файл

@ -0,0 +1,4 @@
-e .[ci_tools]
mock;python_version<="2.7"
pytest

Просмотреть файл

@ -0,0 +1,101 @@
# How to write ReplayableTest based VCR tests
The `scenario_tests` package uses the [VCR.py](https://pypi.python.org/pypi/vcrpy) library
to record the HTTP messages exchanged during a program run
and play them back at a later time,
making it useful for creating "scenario tests"
that interact with Azure (or other) services.
These tests can be replayed at a later time without any network activity,
allowing us to detect changes in the Python layers
between the code being tested and the underlying REST API.
## Overview
Tests all derive from the `ReplayableTest` class
found in `azure_devtools.scenario_tests.base`.
This class exposes the VCR tests using the standard Python `unittest` framework
and allows the tests to be discovered by and debugged in Visual Studio.
When you run a test,
the test driver will automatically detect the test is unrecorded
and record the HTTP requests and responses in a .yaml file
(referred to by VCR.py as a "cassette").
If the test succeeds, the cassette will be preserved
and future playthroughs of the test will come from the cassette
rather than using actual network communication.
If the tests are run on TravisCI,
any tests which cannot be replayed will automatically fail.
`ReplayableTest` itself derives from `IntegrationTestBase`,
which provides some helpful methods for use in more general unit tests
but no functionality pertaining to network communication.
## Configuring ReplayableTest
The only configuration of `ReplayableTest` that is "exposed"
(in the sense of being accessible other than through subclassing)
is whether tests should be run in "live" or "playback" mode.
This can be set in the following two ways,
of which the first takes precedence:
* Set the environment variable `AZURE_TEST_RUN_LIVE`.
Any value will cause the tests to run in live mode;
if the variable is unset the default of playback mode will be used.
* Specify a boolean value for `live-mode` in a configuration file,
the path to which must be specified by a `ReplayableTest` subclass as described below
(i.e. by default no config file will be read).
True values mean "live" mode; false ones mean "playback."
"Live" and "playback" mode are actually just shorthand for recording modes
in the underlying VCR.py package;
they correspond to "all" and "once"
as described in the [VCR.py documentation](http://vcrpy.readthedocs.io/en/latest/usage.html#record-modes).
### Subclassing ReplayableTest and features
Most customization of `ReplayableTest` is accessible only through subclassing.
The two main users of `ReplayableTest` are
[azure-cli](https://github.com/Azure/azure-cli)
and [azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python).
Each uses a subclass of `ReplayableTest` to add context-specific functionality
and preserve backward compatibility with test code
prior to the existence of `azure-devtools`.
For example, azure-cli's [compatibility layer](https://github.com/Azure/azure-cli/tree/master/src/azure-cli-testsdk)
adds methods for running CLI commands and evaluating their output.
Subclasses of `ReplayableTest` can configure its behavior
by passing the following keyword arguments when they call
its `__init__` method (probably using `super`):
* `config_file`: Path to a configuration file.
It should be in the format described in Python's
[ConfigParser](https://docs.python.org/3/library/configparser.html) docs
and currently allows only the boolean option `live-mode`.
* `recording_dir` and `recording_name`:
Directory path and file name, respectively,
for the recording that should be used for a given test case.
By default, the directory will be a `recordings` directory
in the same location as the file containing the test case,
and the file name will be the same as the test method name.
A `.yaml` extension will be appended to whatever is used for `recording_name`.
* `recording_processors` and `replay_processors`:
Lists of `RecordingProcessor` instances for making changes to requests and responses
during test recording and test playback, respectively.
See [recording_processors.py](src/azure_devtools/scenario_tests/recording_processors.py)
for some examples and how to implement them.
* `recording_patches` and `replay_patches`:
Lists of patches to apply to functions, methods, etc.
during test recording and playback, respectively.
See [patches.py](src/azure_devtools/scenario_tests/patches.py)
for some examples. Note the `mock_in_unit_test` function
which abstracts out some boilerplate for applying a patch.
<!--
Note: This document's source uses
[semantic linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/)
to make diffs and updates clearer.
-->

Просмотреть файл

@ -0,0 +1,4 @@
#!/usr/bin/env bash
pylint src/azure_devtools
pytest src/azure_devtools/scenario_tests/tests --cov=./

Просмотреть файл

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

Просмотреть файл

@ -0,0 +1,63 @@
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import io
from setuptools import setup
VERSION = "1.1.1"
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: MIT License',
]
DEPENDENCIES = [
'ConfigArgParse>=0.12.0',
'six>=1.10.0',
'vcrpy>=1.11.0',
]
with io.open('README.rst', 'r', encoding='utf-8') as f:
README = f.read()
setup(
name='azure-devtools',
version=VERSION,
description='Microsoft Azure Development Tools for SDK',
long_description=README,
license='MIT',
author='Microsoft Corporation',
author_email='ptvshelp@microsoft.com',
url='https://github.com/Azure/azure-python-devtools',
zip_safe=False,
classifiers=CLASSIFIERS,
packages=[
'azure_devtools',
'azure_devtools.scenario_tests',
'azure_devtools.ci_tools',
],
extras_require={
'ci_tools':[
"PyGithub>=1.40", # Can Merge PR after 1.36, "requests" and tests after 1.40
"GitPython",
"requests>=2.0"
]
},
package_dir={'': 'src'},
install_requires=DEPENDENCIES,
)

Просмотреть файл

Просмотреть файл

@ -0,0 +1,4 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -0,0 +1,121 @@
from collections import namedtuple
from functools import lru_cache
import logging
import os
import re
from github import Github, GithubException, UnknownObjectException
from .github_tools import (
exception_to_github,
)
_LOGGER = logging.getLogger(__name__)
def order(function):
function.bot_order = True
return function
WebhookMetadata = namedtuple(
'WebhookMetadata',
['repo', 'issue', 'text', 'comment']
)
def build_from_issue_comment(gh_token, body):
"""Create a WebhookMetadata from a comment added to an issue.
"""
if body["action"] in ["created", "edited"]:
github_con = Github(gh_token)
repo = github_con.get_repo(body['repository']['full_name'])
issue = repo.get_issue(body['issue']['number'])
text = body['comment']['body']
try:
comment = issue.get_comment(body['comment']['id'])
except UnknownObjectException:
# If the comment has already disapeared, skip the command
return None
return WebhookMetadata(repo, issue, text, comment)
return None
def build_from_issues(gh_token, body):
"""Create a WebhookMetadata from an opening issue text.
"""
if body["action"] in ["opened", "edited"]:
github_con = Github(gh_token)
repo = github_con.get_repo(body['repository']['full_name'])
issue = repo.get_issue(body['issue']['number'])
text = body['issue']['body']
comment = issue # It's where we update the comment: in the issue itself
return WebhookMetadata(repo, issue, text, comment)
return None
@lru_cache()
def robot_name_from_env_variable():
github_con = Github(os.environ["GH_TOKEN"])
return github_con.get_user().login
class BotHandler:
def __init__(self, handler, robot_name=None, gh_token=None):
self.handler = handler
self.gh_token = gh_token or os.environ["GH_TOKEN"]
self.robot_name = robot_name or robot_name_from_env_variable()
def _is_myself(self, body):
return body['sender']['login'].lower() == self.robot_name.lower()
def issue_comment(self, body):
if self._is_myself(body):
return {'message': 'I don\'t talk to myself, I\'m not schizo'}
webhook_data = build_from_issue_comment(self.gh_token, body)
return self.manage_comment(webhook_data)
def issues(self, body):
if self._is_myself(body):
return {'message': 'I don\'t talk to myself, I\'m not schizo'}
webhook_data = build_from_issues(self.gh_token, body)
return self.manage_comment(webhook_data)
def orders(self):
"""Return method tagged "order" in the handler.
"""
return [order_cmd for order_cmd in dir(self.handler)
if getattr(getattr(self.handler, order_cmd), "bot_order", False)]
def manage_comment(self, webhook_data):
if webhook_data is None:
return {'message': 'Nothing for me'}
# Is someone talking to me:
message = re.search("@{} (.*)".format(self.robot_name), webhook_data.text, re.I)
response = None
if message:
command = message.group(1)
split_text = command.lower().split()
orderstr = split_text.pop(0)
if orderstr == "help":
response = self.help_order()
elif orderstr in self.orders():
try: # Reaction is fun, but it's preview not prod.
# Be careful, don't fail the command if we can't thumbs up...
webhook_data.comment.create_reaction("+1")
except GithubException:
pass
with exception_to_github(webhook_data.issue): # Just in case
response = getattr(self.handler, orderstr)(webhook_data.issue, *split_text)
else:
response = "I didn't understand your command:\n```bash\n{}\n```\nin this context, sorry :(\n".format(
command
)
response += self.help_order()
if response:
webhook_data.issue.create_comment(response)
return {'message': response}
return {'message': 'Nothing for me or exception'}
def help_order(self):
orders = ["This is what I can do:"]
for orderstr in self.orders():
orders.append("- `{}`".format(orderstr))
orders.append("- `help` : this help message")
return "\n".join(orders)

Просмотреть файл

@ -0,0 +1,90 @@
"""Pure git tools for managing local folder Git.
"""
import logging
from git import Repo, GitCommandError
_LOGGER = logging.getLogger(__name__)
def checkout_and_create_branch(repo, name):
"""Checkout branch. Create it if necessary"""
local_branch = repo.branches[name] if name in repo.branches else None
if not local_branch:
if name in repo.remotes.origin.refs:
# If origin branch exists but not local, git.checkout is the fatest way
# to create local branch with origin link automatically
msg = repo.git.checkout(name)
_LOGGER.debug(msg)
return
# Create local branch, will be link to origin later
local_branch = repo.create_head(name)
local_branch.checkout()
def checkout_create_push_branch(repo, name):
"""Checkout this branch. Create it if necessary, and push it to origin.
"""
try:
repo.git.checkout(name)
_LOGGER.info("Checkout %s success", name)
except GitCommandError:
_LOGGER.info("Checkout %s was impossible (branch does not exist). Creating it and push it.", name)
checkout_and_create_branch(repo, name)
repo.git.push('origin', name, set_upstream=True)
def do_commit(repo, message_template, branch_name, hexsha):
"Do a commit if modified/untracked files"
repo.git.add(repo.working_tree_dir)
if not repo.git.diff(staged=True):
_LOGGER.warning('No modified files in this Autorest run')
return False
checkout_and_create_branch(repo, branch_name)
msg = message_template.format(hexsha=hexsha)
commit = repo.index.commit(msg)
_LOGGER.info("Commit done: %s", msg)
return commit.hexsha
def get_repo_hexsha(git_folder):
"""Get the SHA1 of the current repo"""
repo = Repo(str(git_folder))
if repo.bare:
not_git_hexsha = "notgitrepo"
_LOGGER.warning("Not a git repo, SHA1 used will be: %s", not_git_hexsha)
return not_git_hexsha
hexsha = repo.head.commit.hexsha
_LOGGER.info("Found REST API repo SHA1: %s", hexsha)
return hexsha
def checkout_with_fetch(git_folder, refspec, repository="origin"):
"""Fetch the refspec, and checkout FETCH_HEAD.
Beware that you will ne in detached head mode.
"""
_LOGGER.info("Trying to fetch and checkout %s", refspec)
repo = Repo(str(git_folder))
repo.git.fetch(repository, refspec) # FETCH_HEAD should be set
repo.git.checkout("FETCH_HEAD")
_LOGGER.info("Fetch and checkout success for %s", refspec)
def clone_to_path(https_authenticated_url, folder, branch_or_commit=None):
"""Clone the given URL to the folder.
:param str branch_or_commit: If specified, switch to this branch. Branch must exist.
"""
_LOGGER.info("Cloning repo")
repo = Repo.clone_from(https_authenticated_url, str(folder))
# Do NOT clone and set branch at the same time, since we allow branch to be a SHA1
# And you can't clone a SHA1
if branch_or_commit:
_LOGGER.info("Checkout branch_or_commit %s", branch_or_commit)
repo.git.checkout(branch_or_commit)
_LOGGER.info("Clone success")
def get_files_in_commit(git_folder, commit_id="HEAD"):
"""List of files in HEAD commit.
"""
repo = Repo(str(git_folder))
output = repo.git.diff("--name-only", commit_id+"^", commit_id)
return output.splitlines()

Просмотреть файл

@ -0,0 +1,374 @@
"""Github tools.
"""
from contextlib import contextmanager
import logging
import os
from pathlib import Path
import shutil
import stat
from subprocess import CalledProcessError
import traceback
from urllib.parse import urlsplit, urlunsplit
from github import Github, GithubException
from git import Repo
from .git_tools import (
clone_to_path as _git_clone_to_path,
checkout_with_fetch
)
_LOGGER = logging.getLogger(__name__)
class ExceptionContext: # pylint: disable=too-few-public-methods
def __init__(self):
self.comment = None
@contextmanager
def exception_to_github(github_obj_to_comment, summary=""):
"""If any exception comes, log them in the given Github obj.
"""
context = ExceptionContext()
try:
yield context
except Exception: # pylint: disable=broad-except
if summary:
summary = ": ({})".format(summary)
error_type = "an unknown error"
try:
raise
except CalledProcessError as err:
error_type = "a Subprocess error"
content = "Command: {}\n".format(err.cmd)
content += "Finished with return code {}\n".format(err.returncode)
if err.output:
content += "and output:\n```shell\n{}\n```".format(err.output)
else:
content += "and no output"
except Exception: # pylint: disable=broad-except
content = "```python\n{}\n```".format(traceback.format_exc())
response = "<details><summary>Encountered {}{}</summary><p>\n\n".format(
error_type,
summary
)
response += content
response += "\n\n</p></details>"
context.comment = create_comment(github_obj_to_comment, response)
def user_from_token(gh_token):
"""Get user login from GitHub token"""
github_con = Github(gh_token)
return github_con.get_user()
def create_comment(github_object, body):
"""Create a comment, whatever the object is a PR, a commit or an issue.
"""
try:
return github_object.create_issue_comment(body) # It's a PR
except AttributeError:
return github_object.create_comment(body) # It's a commit/issue
def get_comments(github_object):
"""Get a list of comments, whater the object is a PR, a commit or an issue.
"""
try:
return github_object.get_issue_comments() # It's a PR
except AttributeError:
return github_object.get_comments() # It's a commit/issue
def get_files(github_object):
"""Get files from a PR or a commit.
"""
try:
return github_object.get_files() # Try as a PR object
except AttributeError:
return github_object.files # Try as a commit object
def configure_user(gh_token, repo):
"""git config --global user.email "you@example.com"
git config --global user.name "Your Name"
"""
user = user_from_token(gh_token)
repo.git.config('user.email', user.email or 'adxpysdk@microsoft.com')
repo.git.config('user.name', user.name or 'SwaggerToSDK Automation')
def get_full_sdk_id(gh_token, sdk_git_id):
"""If the SDK git id is incomplete, try to complete it with user login"""
if not '/' in sdk_git_id:
login = user_from_token(gh_token).login
return '{}/{}'.format(login, sdk_git_id)
return sdk_git_id
def sync_fork(gh_token, github_repo_id, repo, push=True):
"""Sync the current branch in this fork against the direct parent on Github"""
if not gh_token:
_LOGGER.warning('Skipping the upstream repo sync, no token')
return
_LOGGER.info('Check if repo has to be sync with upstream')
github_con = Github(gh_token)
github_repo = github_con.get_repo(github_repo_id)
if not github_repo.parent:
_LOGGER.warning('This repo has no upstream')
return
upstream_url = 'https://github.com/{}.git'.format(github_repo.parent.full_name)
upstream = repo.create_remote('upstream', url=upstream_url)
upstream.fetch()
active_branch_name = repo.active_branch.name
if not active_branch_name in repo.remotes.upstream.refs:
_LOGGER.info('Upstream has no branch %s to merge from', active_branch_name)
return
else:
_LOGGER.info('Merge from upstream')
msg = repo.git.rebase('upstream/{}'.format(repo.active_branch.name))
_LOGGER.debug(msg)
if push:
msg = repo.git.push()
_LOGGER.debug(msg)
def get_or_create_pull(github_repo, title, body, head, base, *, none_if_no_commit=False):
"""Try to create the PR. If the PR exists, try to find it instead. Raises otherwise.
You should always use the complete head syntax "org:branch", since the syntax is required
in case of listing.
if "none_if_no_commit" is set, return None instead of raising exception if the problem
is that head and base are the same.
"""
try: # Try to create or get a PR
return github_repo.create_pull(
title=title,
body=body,
head=head,
base=base
)
except GithubException as err:
err_message = err.data['errors'][0].get('message', '')
if err.status == 422 and err_message.startswith('A pull request already exists'):
_LOGGER.info('PR already exists, get this PR')
return list(github_repo.get_pulls(
head=head,
base=base
))[0]
elif none_if_no_commit and err.status == 422 and err_message.startswith('No commits between'):
_LOGGER.info('No PR possible since head %s and base %s are the same',
head,
base)
return None
else:
_LOGGER.warning("Unable to create PR:\n%s", err.data)
raise
except Exception as err:
response = traceback.format_exc()
_LOGGER.warning("Unable to create PR:\n%s", response)
raise
def clone_to_path(gh_token, folder, sdk_git_id, branch_or_commit=None, *, pr_number=None):
"""Clone the given repo_id to the folder.
If PR number is specified fetch the magic branches
pull/<id>/head or pull/<id>/merge from Github. "merge" is tried first, and fallback to "head".
Beware that pr_number implies detached head, and then no push is possible.
If branch is specified, checkout this branch or commit finally.
:param str branch_or_commit: If specified, switch to this branch/commit.
:param int pr_number: PR number.
"""
_LOGGER.info("Clone SDK repository %s", sdk_git_id)
url_parsing = urlsplit(sdk_git_id)
sdk_git_id = url_parsing.path
if sdk_git_id.startswith("/"):
sdk_git_id = sdk_git_id[1:]
credentials_part = ''
if gh_token:
login = user_from_token(gh_token).login
credentials_part = '{user}:{token}@'.format(
user=login,
token=gh_token
)
else:
_LOGGER.warning('Will clone the repo without writing credentials')
https_authenticated_url = 'https://{credentials}github.com/{sdk_git_id}.git'.format(
credentials=credentials_part,
sdk_git_id=sdk_git_id
)
# Clone the repo
_git_clone_to_path(https_authenticated_url, folder)
# If this is a PR, do some fetch to improve the number of SHA1 available
if pr_number:
try:
checkout_with_fetch(folder, "pull/{}/merge".format(pr_number))
return
except Exception: # pylint: disable=broad-except
pass # Assume "merge" doesn't exist anymore, fetch "head"
checkout_with_fetch(folder, "pull/{}/head".format(pr_number))
# If there is SHA1, checkout it. If PR number was given, SHA1 could be inside that PR.
if branch_or_commit:
repo = Repo(str(folder))
repo.git.checkout(branch_or_commit)
def do_pr(gh_token, sdk_git_id, sdk_pr_target_repo_id, branch_name, base_branch, pr_body=""): # pylint: disable=too-many-arguments
"Do the PR"
if not gh_token:
_LOGGER.info('Skipping the PR, no token found')
return None
if not sdk_pr_target_repo_id:
_LOGGER.info('Skipping the PR, no target repo id')
return None
github_con = Github(gh_token)
sdk_pr_target_repo = github_con.get_repo(sdk_pr_target_repo_id)
if '/' in sdk_git_id:
sdk_git_owner = sdk_git_id.split('/')[0]
_LOGGER.info("Do the PR from %s", sdk_git_owner)
head_name = "{}:{}".format(sdk_git_owner, branch_name)
else:
head_name = branch_name
sdk_git_repo = github_con.get_repo(sdk_git_id)
sdk_git_owner = sdk_git_repo.owner.login
try:
github_pr = sdk_pr_target_repo.create_pull(
title='Automatic PR from {}'.format(branch_name),
body=pr_body,
head=head_name,
base=base_branch
)
except GithubException as err:
if err.status == 422 and err.data['errors'][0].get('message', '').startswith('A pull request already exists'):
matching_pulls = sdk_pr_target_repo.get_pulls(base=base_branch, head=sdk_git_owner+":"+head_name)
matching_pull = matching_pulls[0]
_LOGGER.info('PR already exists: %s', matching_pull.html_url)
return matching_pull
raise
_LOGGER.info("Made PR %s", github_pr.html_url)
return github_pr
def remove_readonly(func, path, _):
"Clear the readonly bit and reattempt the removal"
os.chmod(path, stat.S_IWRITE)
func(path)
@contextmanager
def manage_git_folder(gh_token, temp_dir, git_id, *, pr_number=None):
"""Context manager to avoid readonly problem while cleanup the temp dir.
If PR number is given, use magic branches "pull" from Github.
"""
_LOGGER.debug("Git ID %s", git_id)
if Path(git_id).exists():
yield git_id
return # Do not erase a local folder, just skip here
# Clone the specific branch
split_git_id = git_id.split("@")
branch = split_git_id[1] if len(split_git_id) > 1 else None
clone_to_path(gh_token, temp_dir, split_git_id[0], branch_or_commit=branch, pr_number=pr_number)
try:
yield temp_dir
# Pre-cleanup for Windows http://bugs.python.org/issue26660
finally:
_LOGGER.debug("Preclean Rest folder")
shutil.rmtree(temp_dir, onerror=remove_readonly)
class GithubLink:
def __init__(self, gitid, link_type, branch_or_commit, path, token=None): # pylint: disable=too-many-arguments
self.gitid = gitid
self.link_type = link_type
self.branch_or_commit = branch_or_commit
self.path = path
self.token = token
@classmethod
def from_string(cls, github_url):
parsed = urlsplit(github_url)
netloc = parsed.netloc
if "@" in netloc:
token, netloc = netloc.split("@")
else:
token = None
split_path = parsed.path.split("/")
split_path.pop(0) # First is always empty
gitid = split_path.pop(0) + "/" + split_path.pop(0)
link_type = split_path.pop(0) if netloc != "raw.githubusercontent.com" else "raw"
branch_or_commit = split_path.pop(0)
path = "/".join(split_path)
return cls(gitid, link_type, branch_or_commit, path, token)
def __repr__(self):
if self.link_type == "raw":
netloc = "raw.githubusercontent.com"
path = "/".join(["", self.gitid, self.branch_or_commit, self.path])
# If raw and token, needs to be passed with "Authorization: token <token>", so nothing to do here
else:
netloc = "github.com" if not self.token else self.token + "@github.com"
path = "/".join(["", self.gitid, self.link_type, self.branch_or_commit, self.path])
return urlunsplit(("https", netloc, path, '', ''))
def as_raw_link(self):
"""Returns a GithubLink to a raw content.
"""
if self.link_type == "raw":
return self # Can be discussed if we need an hard copy, or fail
if self.link_type != "blob":
raise ValueError("Cannot get a download link from a tree link")
return self.__class__(
self.gitid,
"raw",
self.branch_or_commit,
self.path,
self.token
)
class DashboardCommentableObject: # pylint: disable=too-few-public-methods
def __init__(self, issue_or_pr, header):
self._issue_or_pr = issue_or_pr
self._header = header
def create_comment(self, text):
"""Mimic issue API, so we can use it everywhere.
Return dashboard comment.
"""
return DashboardComment.get_or_create(self._issue_or_pr, self._header, text)
class DashboardComment:
def __init__(self, github_comment, header):
self.github_comment = github_comment
self._header = header
@classmethod
def get_or_create(cls, issue, header, text=None):
"""Get or create the dashboard comment in this issue.
"""
for comment in get_comments(issue):
try:
if comment.body.splitlines()[0] == header:
obj = cls(comment, header)
break
except IndexError: # The comment body is empty
pass
# Hooooooo, no dashboard comment, let's create one
else:
comment = create_comment(issue, header)
obj = cls(comment, header)
if text:
obj.edit(text)
return obj
def edit(self, text):
self.github_comment.edit(self._header+"\n"+text)
@property
def body(self):
return self.github_comment.body[len(self._header+"\n"):]
def delete(self):
self.github_comment.delete()

Просмотреть файл

@ -0,0 +1,77 @@
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/17
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4868'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"98b4fc509c1be25d2318a54b8c92958d"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:24 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.067750'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1584:97BA:C8520B:103DCD4:5AFDF1D7')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/17","id":296837951,"number":17,"title":"Bot testing test_bot_basic_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:21:32Z","updated_at":"2018-05-17T21:17:24Z","closed_at":null,"author_association":"OWNER","body":"Issue for test test_bot_basic_command","closed_by":null}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4867'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.068194'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1585:97AE:D648:1542E:5AFDF1D7')]
{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/17
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4866'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"98b4fc509c1be25d2318a54b8c92958d"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:24 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.056033'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1586:97B6:619CDF:7E742E:5AFDF1D7')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/17","id":296837951,"number":17,"title":"Bot testing test_bot_basic_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:21:32Z","updated_at":"2018-05-17T21:17:24Z","closed_at":null,"author_association":"OWNER","body":"Issue for test test_bot_basic_command","closed_by":null}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/17/reactions
{'Accept': 'application/vnd.github.squirrel-girl-preview', 'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"content": "+1"}
200
[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4865'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"830905522c930d77c944e2465cbf79e3"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.squirrel-girl-preview'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.049763'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1587:97BA:C85240:103DD1C:5AFDF1D7')]
{"id":19647639,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"content":"+1","created_at":"2018-02-15T16:48:56Z"}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/17/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "I did something with myparameter"}
201
[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1269'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4864'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"3c8c70479a1f9d4bd626e25a0fb202d5"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015300'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.235969'), ('X-GitHub-Request-Id', '1589:97BA:C8524D:103DD2D:5AFDF1D7')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015300","html_url":"https://github.com/lmazuel/TestingRepo/issues/17#issuecomment-390015300","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","id":390015300,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:19Z","updated_at":"2018-05-17T21:19:19Z","author_association":"OWNER","body":"I did something with myparameter"}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/17/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4863'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"74c8cfcaef98bcea9d03825eaf8e8bcb"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.075117'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158A:97B8:C19E00:FA7576:5AFDF1D8')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015300","html_url":"https://github.com/lmazuel/TestingRepo/issues/17#issuecomment-390015300","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","id":390015300,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:19Z","updated_at":"2018-05-17T21:19:19Z","author_association":"OWNER","body":"I did something with myparameter"}]
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390015300
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4862'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.153464'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '158B:97B4:2A9DDC:371568:5AFDF1D8')]

Просмотреть файл

@ -0,0 +1,77 @@
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/18
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4861'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"927f79403c0b19d9941c1f9971554c97"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:25 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.091675'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158C:97B8:C19E27:FA75AE:5AFDF1D8')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/18","id":296839107,"number":18,"title":"Bot testing test_bot_basic_failure","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-13T18:25:38Z","updated_at":"2018-05-17T21:17:25Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_basic_failure","closed_by":null}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4860'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.071013'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158D:97B8:C19E34:FA75C6:5AFDF1D8')]
{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/18
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4859'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"927f79403c0b19d9941c1f9971554c97"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:25 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.077929'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158E:97B6:619D50:7E74CE:5AFDF1D9')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/18","id":296839107,"number":18,"title":"Bot testing test_bot_basic_failure","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-13T18:25:38Z","updated_at":"2018-05-17T21:17:25Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_basic_failure","closed_by":null}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/18/reactions
{'Accept': 'application/vnd.github.squirrel-girl-preview', 'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"content": "+1"}
200
[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4858'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"f35e383770b095bc94f549fe44edc2fe"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.squirrel-girl-preview'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.068572'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158F:97BA:C852D8:103DDF9:5AFDF1D9')]
{"id":19647644,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"content":"+1","created_at":"2018-02-15T16:48:58Z"}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/18/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "<details><summary>Encountered an unknown error</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
201
[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1367'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4857'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"06822f58759ca9c9cd53dc2e99a93569"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015309'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.233947'), ('X-GitHub-Request-Id', '1590:97BA:C852EB:103DE13:5AFDF1D9')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015309","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-390015309","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":390015309,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:21Z","updated_at":"2018-05-17T21:19:21Z","author_association":"OWNER","body":"<details><summary>Encountered an unknown error</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/18/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4856'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"a5b1ec4e91e863af61c812af3c2a3308"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.052239'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1591:97BA:C85304:103DE35:5AFDF1D9')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/378008509","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-378008509","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":378008509,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T18:49:03Z","updated_at":"2018-04-02T18:49:03Z","author_association":"OWNER","body":"<details><summary>Encountered an unknown error</summary><p>\n\n```python\nTraceback (most recent call last):\n File \"/home/travis/build/lmazuel/swagger-to-sdk/swaggertosdk/github_tools.py\", line 32, in exception_to_github\n yield context\n File \"/home/travis/build/lmazuel/swagger-to-sdk/swaggertosdk/restapi/bot_framework.py\", line 104, in manage_comment\n response = getattr(self.handler, orderstr)(webhook_data.issue, *split_text)\n File \"/home/travis/build/lmazuel/swagger-to-sdk/tests/test_bot_framework.py\", line 134, in command1\n raise ValueError(\"Not happy\")\nValueError: Not happy\n\n```\n\n</p></details>"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390014728","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-390014728","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":390014728,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:17:25Z","updated_at":"2018-05-17T21:17:25Z","author_association":"OWNER","body":"<details><summary>Encountered an unknown error</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015309","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-390015309","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":390015309,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:21Z","updated_at":"2018-05-17T21:19:21Z","author_association":"OWNER","body":"<details><summary>Encountered an unknown error</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}]
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390015309
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4855'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.105747'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1592:97BA:C85310:103DE44:5AFDF1DA')]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,66 @@
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/19
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4848'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"817b6384493b05bdc635dcb4b3ed97e9"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:28 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.072901'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1599:97B6:619DF4:7E75B2:5AFDF1DC')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/19","id":296841237,"number":19,"title":"Bot testing test_bot_unknown_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:32:59Z","updated_at":"2018-05-17T21:17:28Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_unknown_command","closed_by":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false}}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4847'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.075721'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '159A:97B8:C19F3B:FA772C:5AFDF1DC')]
{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/19
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4846'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"817b6384493b05bdc635dcb4b3ed97e9"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:28 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054579'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '159B:97BA:C853B6:103DF3D:5AFDF1DC')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/19","id":296841237,"number":19,"title":"Bot testing test_bot_unknown_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:32:59Z","updated_at":"2018-05-17T21:17:28Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_unknown_command","closed_by":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false}}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/19/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "I didn't understand your command:\n```bash\ncommand1 myparameter\n```\nin this context, sorry :(\nThis is what I can do:\n- `help` : this help message"}
201
[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1387'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4845'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"7e5e5bc1d93fe17033b3690c64d1de5c"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015326'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.287623'), ('X-GitHub-Request-Id', '159C:97BA:C853C6:103DF50:5AFDF1DC')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015326","html_url":"https://github.com/lmazuel/TestingRepo/issues/19#issuecomment-390015326","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","id":390015326,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:24Z","updated_at":"2018-05-17T21:19:24Z","author_association":"OWNER","body":"I didn't understand your command:\n```bash\ncommand1 myparameter\n```\nin this context, sorry :(\nThis is what I can do:\n- `help` : this help message"}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/19/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4844'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"2f96a1efc55bec5c0d05b8eb07192251"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.061455'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '159D:97B8:C19F68:FA7775:5AFDF1DD')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015326","html_url":"https://github.com/lmazuel/TestingRepo/issues/19#issuecomment-390015326","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","id":390015326,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:24Z","updated_at":"2018-05-17T21:19:24Z","author_association":"OWNER","body":"I didn't understand your command:\n```bash\ncommand1 myparameter\n```\nin this context, sorry :(\nThis is what I can do:\n- `help` : this help message"}]
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390015326
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4843'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.119982'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '159F:97BA:C853F6:103DF8C:5AFDF1DD')]

Просмотреть файл

@ -0,0 +1,66 @@
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4842'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.053636'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A0:97B6:619E2D:7E75FD:5AFDF1DD')]
{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/16
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4841'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"7d2748617881607a7850e67e06267e71"'), ('Last-Modified', 'Thu, 17 May 2018 21:19:23 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.076099'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A1:97BA:C8540D:103DFB0:5AFDF1DD')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/16","id":296581533,"number":16,"title":"Bot testing test_bot_help","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T01:16:25Z","updated_at":"2018-05-17T21:19:23Z","closed_at":null,"author_association":"OWNER","body":"This is bot testing. Test framework will use this issue to test if bot can understand what we are saying. Webhook will be faked.","closed_by":null}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4840'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.069166'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A2:97BA:C8541C:103DFC4:5AFDF1DD')]
{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/16
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4839'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"7d2748617881607a7850e67e06267e71"'), ('Last-Modified', 'Thu, 17 May 2018 21:19:23 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.070185'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A3:97B4:2A9E5A:37161B:5AFDF1DD')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/16","id":296581533,"number":16,"title":"Bot testing test_bot_help","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T01:16:25Z","updated_at":"2018-05-17T21:19:23Z","closed_at":null,"author_association":"OWNER","body":"This is bot testing. Test framework will use this issue to test if bot can understand what we are saying. Webhook will be faked.","closed_by":null}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/365120206
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4838'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"9ae58cc064227ab7ba03d6700bc43271"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.060661'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A4:97B6:619E50:7E7635:5AFDF1DE')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/365120206","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-365120206","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":365120206,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T01:24:00Z","updated_at":"2018-02-13T01:24:00Z","author_association":"OWNER","body":"This is what I can do:\n - `help` : this help message\n - `generate <raw github path to a readme>` : create a PR for this README\n "}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4837'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.059502'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A5:97BA:C85441:103DFF5:5AFDF1DE')]
{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,11 @@
https
GET
api.github.com
None
/user
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:30 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4801'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.050830'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '16F8:97BA:C9220B:104EE7D:5AFDF3C2')]
{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,110 @@
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4794'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"f7880303c57eae4c85d647cee834e3f6"'), ('Last-Modified', 'Thu, 17 May 2018 21:15:07 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054964'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '16FF:97BA:C922DA:104EF8A:5AFDF3C5')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/15","id":293729231,"number":15,"title":"Dashboard testing","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-02T00:09:29Z","updated_at":"2018-05-17T21:15:07Z","closed_at":null,"author_association":"OWNER","body":"","closed_by":null}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4793'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"394698f297e36caa81023c22d91e8f84"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.106485'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1700:97BA:C922E8:104EF9A:5AFDF3C5')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"}]
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4792'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"394698f297e36caa81023c22d91e8f84"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.066016'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1701:97B8:C246C0:FB55B0:5AFDF3C5')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"}]
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "# MYHEADER"}
201
[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1247'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4791'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"772f2729f150f5896d0a03475c5dd0c5"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.190633'), ('X-GitHub-Request-Id', '1702:97B8:C246D0:FB55C5:5AFDF3C5')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:33Z","author_association":"OWNER","body":"# MYHEADER"}
https
PATCH
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017687
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "# MYHEADER\n<details><summary>Encountered an unknown error: (Python bot)</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
200
[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4790'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"bd0982c93a87b03a313876721ccc76a4"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.191203'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1703:97B8:C246F0:FB55EC:5AFDF3C5')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\n<details><summary>Encountered an unknown error: (Python bot)</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4789'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"b91f459a1d0337ede82a9105fa62ce19"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.075426'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1704:97BA:C92330:104F002:5AFDF3C6')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\n<details><summary>Encountered an unknown error: (Python bot)</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}]
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4788'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"b91f459a1d0337ede82a9105fa62ce19"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.070095'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1705:97BA:C92342:104F012:5AFDF3C6')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\n<details><summary>Encountered an unknown error: (Python bot)</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}]
https
PATCH
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017687
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "# MYHEADER\nNew text comment"}
200
[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4787'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"7d8a8bf4af44d34c832747ad13a83446"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.218436'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1706:97B8:C24728:FB5638:5AFDF3C6')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\nNew text comment"}
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/15/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4786'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"2765cea7edb0c5332910282095b1d4c1"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.061215'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1707:97B8:C2473C:FB5658:5AFDF3C6')]
[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\nNew text comment"}]
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017687
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4785'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.126890'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1708:97B4:2AC8C4:374BDD:5AFDF3C7')]

Просмотреть файл

@ -0,0 +1,99 @@
https
GET
api.github.com
None
/repos/lmazuel/TestingRepo/issues/13
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4784'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"5d22339274e7041343287e3bfa73f758"'), ('Last-Modified', 'Thu, 17 May 2018 21:15:10 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.057591'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1709:97B6:61F179:7EE505:5AFDF3C7')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/13","id":290980764,"number":13,"title":"Testing exception","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-23T20:24:40Z","updated_at":"2018-05-17T21:15:10Z","closed_at":null,"author_association":"OWNER","body":"This unittest is doing something stupid, to test I'm able to log in a generic way the stacktrace in Github","closed_by":null}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/13/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "<details><summary>Encountered an unknown error</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
201
[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1367'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4783'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"02c13ce01b48f85e423f4eaaa70ae776"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017694'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.207902'), ('X-GitHub-Request-Id', '170A:97BA:C923A8:104F0A2:5AFDF3C7')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017694","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017694","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017694,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:35Z","updated_at":"2018-05-17T21:27:35Z","author_association":"OWNER","body":"<details><summary>Encountered an unknown error</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017694
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4782'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.137629'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '170B:97B6:61F19A:7EE52A:5AFDF3C7')]
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/13/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "<details><summary>Encountered an unknown error: (Python bot)</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
201
[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1381'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4781'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"80a0e4c3cf7c8e5152378483fc9b6928"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017696'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.177832'), ('X-GitHub-Request-Id', '170C:97B4:2AC8D4:374BF5:5AFDF3C8')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017696","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017696","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017696,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:36Z","updated_at":"2018-05-17T21:27:36Z","author_association":"OWNER","body":"<details><summary>Encountered an unknown error: (Python bot)</summary><p>\n\n```python\nsomething to do with an exception\n```\n\n</p></details>"}
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017696
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4780'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.152868'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '170D:97BA:C923DA:104F0E5:5AFDF3C8')]
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/13/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "<details><summary>Encountered a Subprocess error: (Python bot)</summary><p>\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand output:\n```shell\nError line 1\nError line 2\n```\n\n</p></details>"}
201
[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1453'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4779'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"1b1b351c9807c836fbc5facac7829561"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017699'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.193468'), ('X-GitHub-Request-Id', '170E:97B6:61F1CD:7EE566:5AFDF3C8')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017699","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017699","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017699,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:36Z","updated_at":"2018-05-17T21:27:36Z","author_association":"OWNER","body":"<details><summary>Encountered a Subprocess error: (Python bot)</summary><p>\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand output:\n```shell\nError line 1\nError line 2\n```\n\n</p></details>"}
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017699
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:27:37 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4778'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.129749'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '170F:97BA:C92400:104F11E:5AFDF3C8')]
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/issues/13/comments
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"body": "<details><summary>Encountered a Subprocess error: (Python bot)</summary><p>\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand no output\n\n</p></details>"}
201
[('Date', 'Thu, 17 May 2018 21:27:37 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1412'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4777'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"c63186bf115722901d5391428f67a13b"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017701'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.211042'), ('X-GitHub-Request-Id', '1710:97B8:C24810:FB5779:5AFDF3C9')]
{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017701","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017701","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017701,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:37Z","updated_at":"2018-05-17T21:27:37Z","author_association":"OWNER","body":"<details><summary>Encountered a Subprocess error: (Python bot)</summary><p>\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand no output\n\n</p></details>"}
https
DELETE
api.github.com
None
/repos/lmazuel/TestingRepo/issues/comments/390017701
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Thu, 17 May 2018 21:27:37 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4776'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.150903'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1711:97BA:C92421:104F154:5AFDF3C9')]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,22 @@
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/pulls
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"title": "Title", "body": "Body", "base": "b2", "head": "b1"}
422
[('Date', 'Thu, 17 May 2018 21:27:38 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '209'), ('Server', 'GitHub.com'), ('Status', '422 Unprocessable Entity'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4772'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.087848'), ('X-GitHub-Request-Id', '1715:97B6:61F22E:7EE5EA:5AFDF3CA')]
{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between b2 and b1"}],"documentation_url":"https://developer.github.com/v3/pulls/#create-a-pull-request"}
https
POST
api.github.com
None
/repos/lmazuel/TestingRepo/pulls
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"title": "Title", "body": "Body", "base": "b2", "head": "b1"}
422
[('Date', 'Thu, 17 May 2018 21:27:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '209'), ('Server', 'GitHub.com'), ('Status', '422 Unprocessable Entity'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4771'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.118070'), ('X-GitHub-Request-Id', '1716:97B8:C24888:FB581B:5AFDF3CA')]
{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between b2 and b1"}],"documentation_url":"https://developer.github.com/v3/pulls/#create-a-pull-request"}

Просмотреть файл

@ -0,0 +1,11 @@
https
GET
api.github.com
None
/user
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4770'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.048690'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1717:97B6:61F247:7EE60C:5AFDF3CB')]
{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}

Просмотреть файл

@ -0,0 +1,33 @@
https
GET
api.github.com
None
/user
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4769'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.070117'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1719:97B6:61F253:7EE61B:5AFDF3CB')]
{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}
https
GET
api.github.com
None
/user
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:42 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4768'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054549'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '171C:97B6:61F309:7EE6FD:5AFDF3CE')]
{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}
https
GET
api.github.com
None
/user
{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Thu, 17 May 2018 21:27:46 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4767'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.063164'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '171F:97B8:C24AB5:FB5AD5:5AFDF3D2')]
{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,44 @@
"""Configuration of fixtures for pytest"""
import logging
import os
import sys
import types
from github import Github
import pytest
_LOGGER = logging.getLogger(__name__)
collect_ignore = []
if sys.version_info < (3, 6):
# Might do something more generic later
collect_ignore.append("test_bot_framework.py")
collect_ignore.append("test_git_tools.py")
collect_ignore.append("test_github_tools.py")
_context = {
'login': "login",
'password': "password",
'oauth_token': os.environ.get('GH_TOKEN', 'oauth_token')
}
_test_context_module = types.ModuleType(
'GithubCredentials',
'Module created to provide a context for tests'
)
_test_context_module.__dict__.update(_context)
sys.modules['GithubCredentials'] = _test_context_module
@pytest.fixture
def github_token():
"""Return the Github token to use for real tests."""
if not 'GH_TOKEN' in os.environ:
_LOGGER.warning('GH_TOKEN must be defined for this test')
return "faketoken"
return os.environ['GH_TOKEN']
@pytest.fixture
def github_client(github_token):
"""Return a Github client with configured token."""
return Github(github_token)

Просмотреть файл

@ -0,0 +1,215 @@
import os.path
from unittest import mock
import pytest
from github.tests import Framework
from azure_devtools.ci_tools.bot_framework import BotHandler, order, build_from_issue_comment, build_from_issues
class BotFrameworkTest(Framework.TestCase):
def setUp(self):
self.maxDiff = None # Big diff to come
self.recordMode = False # turn to True to record
self.tokenAuthMode = True
self.replayDataFolder = os.path.join(os.path.dirname(__file__), "ReplayData")
super(BotFrameworkTest, self).setUp()
def test_webhook_data(self):
github_token = self.oauth_token
repo = self.g.get_repo("lmazuel/TestingRepo")
fake_webhook = {
'action': 'opened', # What is the comment state?
'repository': {
'full_name': repo.full_name # On what repo is this command?
},
'issue': {
'number': 16, # On what issue is this comment?
'body': "@AutorestCI help" # Message?
},
'sender': {
'login': "lmazuel" # Who wrote the command?
},
}
webhook_data = build_from_issues(github_token, fake_webhook)
assert webhook_data.text == "@AutorestCI help"
assert webhook_data.issue.number == 16
assert webhook_data.repo.full_name == repo.full_name
fake_webhook = {
'action': 'created', # What is the comment state?
'repository': {
'full_name': repo.full_name # On what repo is this command?
},
'issue': {
'number': 16 # On what issue is this comment?
},
'sender': {
'login': "lmazuel" # Who wrote the command?
},
'comment': {
'id': 365120206,
'body': "@AutorestCI help" # Message?
}
}
webhook_data = build_from_issue_comment(github_token, fake_webhook)
assert webhook_data.text == "@AutorestCI help"
assert webhook_data.issue.number == 16
assert webhook_data.repo.full_name == repo.full_name
def test_bot_help(self):
github_token = self.oauth_token
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(16)
class BotHelp:
@order
def command1(self, issue):
pass
@order
def command2(self, issue):
pass
def notacommand(self):
pass
bot = BotHandler(BotHelp(), "AutorestCI", github_token)
fake_webhook = {
'action': 'opened', # What is the comment state?
'repository': {
'full_name': issue.repository.full_name # On what repo is this command?
},
'issue': {
'number': issue.number, # On what issue is this comment?
'body': "@AutorestCI help" # Message?
},
'sender': {
'login': "lmazuel" # Who wrote the command?
},
}
response = bot.issues(fake_webhook)
assert "this help message" in response["message"]
assert "command1" in response["message"]
assert "notacommand" not in response["message"]
help_comment = list(issue.get_comments())[-1]
assert "this help message" in help_comment.body
assert "command1" in help_comment.body
assert "notacommand" not in help_comment.body
# Clean
help_comment.delete()
def test_bot_basic_command(self):
github_token = self.oauth_token
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(17)
class BotCommand:
@order
def command1(self, issue, param1):
assert issue.number == 17
return "I did something with "+param1
bot = BotHandler(BotCommand(), "AutorestCI", github_token)
fake_webhook = {
'action': 'opened', # What is the comment state?
'repository': {
'full_name': issue.repository.full_name # On what repo is this command?
},
'issue': {
'number': issue.number, # On what issue is this comment?
'body': "@AutorestCI command1 myparameter" # Message?
},
'sender': {
'login': "lmazuel" # Who wrote the command?
},
}
response = bot.issues(fake_webhook)
assert response["message"] == "I did something with myparameter"
help_comment = list(issue.get_comments())[-1]
assert "I did something with myparameter" in help_comment.body
# Clean
help_comment.delete()
@mock.patch('traceback.format_exc')
def test_bot_basic_failure(self, format_exc):
format_exc.return_value = 'something to do with an exception'
github_token = self.oauth_token
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(18)
class BotCommand:
@order
def command1(self, issue, param1):
assert issue.number == 18
raise ValueError("Not happy")
bot = BotHandler(BotCommand(), "AutorestCI", github_token)
fake_webhook = {
'action': 'opened', # What is the comment state?
'repository': {
'full_name': issue.repository.full_name # On what repo is this command?
},
'issue': {
'number': issue.number, # On what issue is this comment?
'body': "@AutorestCI command1 myparameter" # Message?
},
'sender': {
'login': "lmazuel" # Who wrote the command?
},
}
response = bot.issues(fake_webhook)
assert response['message'] == 'Nothing for me or exception'
help_comment = list(issue.get_comments())[-1]
assert "something to do with an exception" in help_comment.body
assert "```python" in help_comment.body
# Clean
help_comment.delete()
def test_bot_unknown_command(self):
github_token = self.oauth_token
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(19)
class BotCommand:
pass
bot = BotHandler(BotCommand(), "AutorestCI", github_token)
fake_webhook = {
'action': 'opened', # What is the comment state?
'repository': {
'full_name': issue.repository.full_name # On what repo is this command?
},
'issue': {
'number': issue.number, # On what issue is this comment?
'body': "@AutorestCI command1 myparameter" # Message?
},
'sender': {
'login': "lmazuel" # Who wrote the command?
},
}
response = bot.issues(fake_webhook)
assert "I didn't understand your command" in response['message']
assert "command1 myparameter" in response['message']
help_comment = list(issue.get_comments())[-1]
assert "I didn't understand your command" in help_comment.body
assert "command1 myparameter" in help_comment.body
# Clean
help_comment.delete()

Просмотреть файл

@ -0,0 +1,72 @@
from pathlib import Path
import tempfile
from git import Repo
from azure_devtools.ci_tools.git_tools import (
do_commit,
get_files_in_commit
)
def test_do_commit():
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
Repo.clone_from('https://github.com/lmazuel/TestingRepo.git', temp_dir)
repo = Repo(temp_dir)
result = do_commit(repo, 'Test {hexsha}', 'testing', 'fakehexsha')
assert not result
assert 'fakehexsha' not in repo.head.commit.message
assert repo.active_branch.name == 'master'
file_path = Path(temp_dir, 'file.txt')
file_path.write_text('Something')
result = do_commit(repo, 'Test {hexsha}', 'testing', 'fakehexsha')
assert result
assert repo.head.commit.message == 'Test fakehexsha'
assert repo.active_branch.name == 'testing'
assert 'file.txt' in repo.head.commit.stats.files
file_path.write_text('New content')
result = do_commit(repo, 'Now it is {hexsha}', 'newbranch', 'new-fakehexsha')
assert result
assert repo.head.commit.message == 'Now it is new-fakehexsha'
assert repo.active_branch.name == 'newbranch'
assert 'file.txt' in repo.head.commit.stats.files
file_path.unlink()
file_path.write_text('New content')
result = do_commit(repo, 'Now it is {hexsha}', 'fakebranch', 'hexsha_not_used')
assert not result
assert repo.head.commit.message == 'Now it is new-fakehexsha'
assert repo.active_branch.name == 'newbranch'
finished = True
except PermissionError:
if finished:
return
raise
def test_get_files_in_commit():
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
Repo.clone_from('https://github.com/lmazuel/swagger-to-sdk.git', temp_dir)
files = get_files_in_commit(temp_dir, "b40451e55b26e3db61ea17bd751181cbf91f60c5")
assert files == [
'swaggertosdk/generate_package.py',
'swaggertosdk/python_sdk_tools.py',
'swaggertosdk/restapi/sdkbot.py'
]
finished = True
except PermissionError:
if finished:
return
raise

Просмотреть файл

@ -0,0 +1,382 @@
import os.path
from pathlib import Path
from subprocess import CalledProcessError
import tempfile
from unittest import mock
import pytest
from git import Repo, GitCommandError
from github import GithubException
from github.tests import Framework
from azure_devtools.ci_tools.github_tools import (
exception_to_github,
user_from_token,
configure_user,
clone_to_path,
manage_git_folder,
do_pr,
get_files,
create_comment,
GithubLink,
DashboardCommentableObject,
DashboardComment,
get_or_create_pull
)
class GithubTools(Framework.TestCase):
def setUp(self):
self.maxDiff = None # Big diff to come
self.recordMode = False # turn to True to record
self.tokenAuthMode = True
self.replayDataFolder = os.path.join(os.path.dirname(__file__), "ReplayData")
super(GithubTools, self).setUp()
@mock.patch('traceback.format_exc')
def test_exception_to_github(self, format_exc):
format_exc.return_value = 'something to do with an exception'
# Prepare
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(13)
# Act
with exception_to_github(issue) as error:
pass
assert error.comment is None
# Act
with exception_to_github(issue) as error:
"Test".fakemethod(12) # pylint: disable=no-member
# Test
assert error.comment is not None
assert "Encountered an unknown error" in error.comment.body
# Clean my mess
error.comment.delete()
# Act
with exception_to_github(issue, "Python bot") as error:
"Test".fakemethod(12) # pylint: disable=no-member
# Test
assert error.comment is not None
assert "Encountered an unknown error: (Python bot)" in error.comment.body
# Clean my mess
error.comment.delete()
# Act
with exception_to_github(issue, "Python bot") as error:
raise CalledProcessError(
2,
["autorest", "readme.md"],
"Error line 1\nError line 2"
)
# Test
assert error.comment is not None
assert "Encountered a Subprocess error: (Python bot)" in error.comment.body
assert "Error line 1" in error.comment.body
# Clean my mess
error.comment.delete()
# Act
with exception_to_github(issue, "Python bot") as error:
raise CalledProcessError(
2,
["autorest", "readme.md"],
)
# Test
assert error.comment is not None
assert "Encountered a Subprocess error: (Python bot)" in error.comment.body
assert "no output" in error.comment.body
# Clean my mess
error.comment.delete()
def test_get_or_create_pull(self):
repo = self.g.get_repo("lmazuel/TestingRepo")
# b1 and b2 should exist and be the same
with pytest.raises(GithubException):
get_or_create_pull(repo, "Title", "Body", "b1", "b2")
prresult = get_or_create_pull(repo, "Title", "Body", "b1", "b2", none_if_no_commit=True)
assert prresult is None
@mock.patch('traceback.format_exc')
def test_dashboard(self, format_exc):
format_exc.return_value = 'something to do with an exception'
# Prepare
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(15)
initial_size = len(list(issue.get_comments()))
header = "# MYHEADER"
dashboard = DashboardCommentableObject(issue, header)
with exception_to_github(dashboard, "Python bot") as error:
"Test".fakemethod(12) # pylint: disable=no-member
after_size = len(list(issue.get_comments()))
assert after_size == initial_size + 1
assert error.comment is not None
assert "Encountered an unknown error" in error.comment.body
dashboard.create_comment("New text comment")
after_size_2 = len(list(issue.get_comments()))
assert after_size == after_size_2
# Clean my mess
error.comment.delete()
def test_get_user(self):
github_token = self.oauth_token
user = user_from_token(github_token)
assert user.login == 'lmazuel'
def test_get_files(self):
repo = self.g.get_repo("Azure/azure-sdk-for-python")
pr = repo.get_pull(1833)
files = get_files(pr)
assert "azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py" in [f.filename for f in files]
commit = repo.get_commit("042b7a5840ff471776bb64e46b50950ee9f84430")
files = get_files(commit)
assert "azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py" in [f.filename for f in files]
def test_create_comment(self):
repo = self.g.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(14)
comment = create_comment(issue, "This is a test")
comment.delete()
pull = repo.get_pull(2)
comment = create_comment(pull, "This is a test")
comment.delete()
def test_configure(self):
github_token = self.oauth_token
finished = False
try:
with tempfile.TemporaryDirectory() as temp_dir:
try:
Repo.clone_from('https://github.com/lmazuel/TestingRepo.git', temp_dir)
repo = Repo(temp_dir)
# If it's not throwing, I'm happy enough
configure_user(github_token, repo)
assert repo.git.config('--get', 'user.name') == 'Laurent Mazuel'
except Exception as err:
print(err)
pytest.fail(err)
else:
finished = True
except PermissionError:
if finished:
return
raise
def test_clone_path(self):
github_token = self.oauth_token
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo")
assert (Path(temp_dir) / Path("README.md")).exists()
finished = True
except PermissionError:
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
clone_to_path(github_token, temp_dir, "https://github.com/lmazuel/TestingRepo")
assert (Path(temp_dir) / Path("README.md")).exists()
finished = True
except PermissionError:
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", "lmazuel-patch-1")
assert (Path(temp_dir) / Path("README.md")).exists()
finished = True
except PermissionError:
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
with pytest.raises(GitCommandError):
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", "fakebranch")
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
# PR 2 must be open, or the test means nothing
try:
with tempfile.TemporaryDirectory() as temp_dir:
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=2)
assert (Path(temp_dir) / Path("README.md")).exists()
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
# PR 1 must be MERGED, or the test means nothing
try:
with tempfile.TemporaryDirectory() as temp_dir:
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=1)
assert (Path(temp_dir) / Path("README.md")).exists()
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
# PR 2 must be opened, or the test means nothing
repo = self.g.get_repo("lmazuel/TestingRepo")
pr = repo.get_pull(2)
try:
with tempfile.TemporaryDirectory() as temp_dir:
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", branch_or_commit=pr.merge_commit_sha, pr_number=2)
assert (Path(temp_dir) / Path("README.md")).stat().st_size >= 107 # File in the PR
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir:
with pytest.raises(GitCommandError):
clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=123456789)
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
def test_manage_git_folder(self):
github_token = self.oauth_token
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir, \
manage_git_folder(github_token, temp_dir, "lmazuel/TestingRepo") as rest_repo:
assert (Path(rest_repo) / Path("README.md")).exists()
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir, \
manage_git_folder(github_token, temp_dir, "lmazuel/TestingRepo@lmazuel-patch-1") as rest_repo:
assert (Path(rest_repo) / Path("README.md")).exists()
assert "lmazuel-patch-1" in str(Repo(rest_repo).active_branch)
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
finished = False # Authorize PermissionError on cleanup
try:
with tempfile.TemporaryDirectory() as temp_dir, \
manage_git_folder(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=1) as rest_repo:
assert (Path(rest_repo) / Path("README.md")).exists()
with pytest.raises(TypeError) as err:
Repo(rest_repo).active_branch
assert "HEAD is a detached symbolic reference" in str(err)
finished = True
except (PermissionError, FileNotFoundError):
if not finished:
raise
def test_do_pr(self):
github_token = self.oauth_token
# Should do nothing
do_pr(None, 'bad', 'bad', 'bad', 'bad')
# Should do nothing
do_pr(github_token, 'bad', None, 'bad', 'bad')
# FIXME - more tests
def test_github_link():
inputstr = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/billing/resource-manager/readme.md"
link = GithubLink.from_string(inputstr)
assert link.gitid == "Azure/azure-rest-api-specs"
assert link.branch_or_commit == "master"
assert link.link_type == "raw"
assert link.path == "specification/billing/resource-manager/readme.md"
assert str(link) == inputstr
raw_link = link.as_raw_link()
assert isinstance(raw_link, GithubLink)
assert str(raw_link) == str(link)
inputstr = "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/billing/resource-manager/readme.md"
link = GithubLink.from_string(inputstr)
assert link.gitid == "Azure/azure-rest-api-specs"
assert link.branch_or_commit == "master"
assert link.link_type == "blob"
assert link.path == "specification/billing/resource-manager/readme.md"
assert str(link) == inputstr
raw_link = link.as_raw_link()
assert isinstance(raw_link, GithubLink)
assert str(raw_link) == "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/billing/resource-manager/readme.md"
inputstr = "https://github.com/Azure/azure-rest-api-specs/tree/master/specification/billing/resource-manager"
link = GithubLink.from_string(inputstr)
assert link.gitid == "Azure/azure-rest-api-specs"
assert link.branch_or_commit == "master"
assert link.link_type == "tree"
assert link.path == "specification/billing/resource-manager"
assert str(link) == inputstr
with pytest.raises(ValueError):
link.as_raw_link()
inputstr = "https://token@github.com/Azure/azure-rest-api-specs/blob/master/specification/billing/resource-manager/readme.md"
link = GithubLink.from_string(inputstr)
assert link.token == "token"
assert link.gitid == "Azure/azure-rest-api-specs"
assert link.branch_or_commit == "master"
assert link.link_type == "blob"
assert link.path == "specification/billing/resource-manager/readme.md"
assert str(link) == inputstr
raw_link = link.as_raw_link()
assert isinstance(raw_link, GithubLink)
# Raw link with token does not use token in URL, since it has to be provided as Authorization: token <token>
assert str(raw_link) == "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/billing/resource-manager/readme.md"

Просмотреть файл

@ -0,0 +1,28 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from .base import IntegrationTestBase, ReplayableTest, LiveTest
from .exceptions import AzureTestError
from .decorators import live_only, record_only, AllowLargeResponse
from .patches import mock_in_unit_test, patch_time_sleep_api, patch_long_run_operation_delay
from .preparers import AbstractPreparer, SingleValueReplacer
from .recording_processors import (
RecordingProcessor, SubscriptionRecordingProcessor,
LargeRequestBodyProcessor, LargeResponseBodyProcessor, LargeResponseBodyReplacer,
OAuthRequestResponsesFilter, DeploymentNameReplacer, GeneralNameReplacer, AccessTokenReplacer, RequestUrlNormalizer,
)
from .utilities import create_random_name, get_sha1_hash
__all__ = ['IntegrationTestBase', 'ReplayableTest', 'LiveTest',
'AzureTestError',
'mock_in_unit_test', 'patch_time_sleep_api', 'patch_long_run_operation_delay',
'AbstractPreparer', 'SingleValueReplacer', 'AllowLargeResponse',
'RecordingProcessor', 'SubscriptionRecordingProcessor',
'LargeRequestBodyProcessor', 'LargeResponseBodyProcessor', 'LargeResponseBodyReplacer',
'OAuthRequestResponsesFilter', 'DeploymentNameReplacer', 'GeneralNameReplacer',
'AccessTokenReplacer', 'RequestUrlNormalizer',
'live_only', 'record_only',
'create_random_name', 'get_sha1_hash']
__version__ = '0.5.2'

Просмотреть файл

@ -0,0 +1,214 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from __future__ import print_function
import unittest
import os
import inspect
import tempfile
import shutil
import logging
import threading
import six
import vcr
from .config import TestConfig
from .const import ENV_TEST_DIAGNOSE
from .utilities import create_random_name
from .decorators import live_only
class IntegrationTestBase(unittest.TestCase):
def __init__(self, method_name):
super(IntegrationTestBase, self).__init__(method_name)
self.diagnose = os.environ.get(ENV_TEST_DIAGNOSE, None) == 'True'
self.logger = logging.getLogger('azure_devtools.scenario_tests')
def create_random_name(self, prefix, length): # pylint: disable=no-self-use
return create_random_name(prefix=prefix, length=length)
def create_temp_file(self, size_kb, full_random=False):
""" Create a temporary file for testing. The test harness will delete the file during tearing down. """
fd, path = tempfile.mkstemp()
os.close(fd)
self.addCleanup(lambda: os.remove(path))
with open(path, mode='r+b') as f:
if full_random:
chunk = os.urandom(1024)
else:
chunk = bytearray([0] * 1024)
for _ in range(size_kb):
f.write(chunk)
return path
def create_temp_dir(self):
"""
Create a temporary directory for testing. The test harness will delete the directory during tearing down.
"""
temp_dir = tempfile.mkdtemp()
self.addCleanup(lambda: shutil.rmtree(temp_dir, ignore_errors=True))
return temp_dir
@classmethod
def set_env(cls, key, val):
os.environ[key] = val
@classmethod
def pop_env(cls, key):
return os.environ.pop(key, None)
@live_only()
class LiveTest(IntegrationTestBase):
pass
class ReplayableTest(IntegrationTestBase): # pylint: disable=too-many-instance-attributes
FILTER_HEADERS = [
'authorization',
'client-request-id',
'retry-after',
'x-ms-client-request-id',
'x-ms-correlation-request-id',
'x-ms-ratelimit-remaining-subscription-reads',
'x-ms-request-id',
'x-ms-routing-request-id',
'x-ms-gateway-service-instanceid',
'x-ms-ratelimit-remaining-tenant-reads',
'x-ms-served-by',
'x-ms-authorization-auxiliary'
]
def __init__(self, # pylint: disable=too-many-arguments
method_name, config_file=None, recording_dir=None, recording_name=None, recording_processors=None,
replay_processors=None, recording_patches=None, replay_patches=None):
super(ReplayableTest, self).__init__(method_name)
self.recording_processors = recording_processors or []
self.replay_processors = replay_processors or []
self.recording_patches = recording_patches or []
self.replay_patches = replay_patches or []
self.config = TestConfig(config_file=config_file)
self.disable_recording = False
test_file_path = inspect.getfile(self.__class__)
recording_dir = recording_dir or os.path.join(os.path.dirname(test_file_path), 'recordings')
self.is_live = self.config.record_mode
self.vcr = vcr.VCR(
cassette_library_dir=recording_dir,
before_record_request=self._process_request_recording,
before_record_response=self._process_response_recording,
decode_compressed_response=True,
record_mode='once' if not self.is_live else 'all',
filter_headers=self.FILTER_HEADERS
)
self.vcr.register_matcher('query', self._custom_request_query_matcher)
self.recording_file = os.path.join(
recording_dir,
'{}.yaml'.format(recording_name or method_name)
)
if self.is_live and os.path.exists(self.recording_file):
os.remove(self.recording_file)
self.in_recording = self.is_live or not os.path.exists(self.recording_file)
self.test_resources_count = 0
self.original_env = os.environ.copy()
def setUp(self):
super(ReplayableTest, self).setUp()
# set up cassette
cm = self.vcr.use_cassette(self.recording_file)
self.cassette = cm.__enter__()
self.addCleanup(cm.__exit__)
# set up mock patches
if self.in_recording:
for patch in self.recording_patches:
patch(self)
else:
for patch in self.replay_patches:
patch(self)
def tearDown(self):
os.environ = self.original_env
# Autorest.Python 2.x
assert not [t for t in threading.enumerate() if t.name.startswith("AzureOperationPoller")], \
"You need to call 'result' or 'wait' on all AzureOperationPoller you have created"
# Autorest.Python 3.x
assert not [t for t in threading.enumerate() if t.name.startswith("LROPoller")], \
"You need to call 'result' or 'wait' on all LROPoller you have created"
def _process_request_recording(self, request):
if self.disable_recording:
return None
if self.in_recording:
for processor in self.recording_processors:
request = processor.process_request(request)
if not request:
break
else:
for processor in self.replay_processors:
request = processor.process_request(request)
if not request:
break
return request
def _process_response_recording(self, response):
from .utilities import is_text_payload
if self.in_recording:
# make header name lower case and filter unwanted headers
headers = {}
for key in response['headers']:
if key.lower() not in self.FILTER_HEADERS:
headers[key.lower()] = response['headers'][key]
response['headers'] = headers
body = response['body']['string']
if is_text_payload(response) and body and not isinstance(body, six.string_types):
response['body']['string'] = body.decode('utf-8')
for processor in self.recording_processors:
response = processor.process_response(response)
if not response:
break
else:
for processor in self.replay_processors:
response = processor.process_response(response)
if not response:
break
return response
@classmethod
def _custom_request_query_matcher(cls, r1, r2):
""" Ensure method, path, and query parameters match. """
from six.moves.urllib_parse import urlparse, parse_qs # pylint: disable=import-error,relative-import
url1 = urlparse(r1.uri)
url2 = urlparse(r2.uri)
q1 = parse_qs(url1.query)
q2 = parse_qs(url2.query)
shared_keys = set(q1.keys()).intersection(set(q2.keys()))
if len(shared_keys) != len(q1) or len(shared_keys) != len(q2):
return False
for key in shared_keys:
if q1[key][0].lower() != q2[key][0].lower():
return False
return True

Просмотреть файл

@ -0,0 +1,28 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import configargparse
from .const import ENV_LIVE_TEST
class TestConfig(object): # pylint: disable=too-few-public-methods
def __init__(self, parent_parsers=None, config_file=None):
parent_parsers = parent_parsers or []
self.parser = configargparse.ArgumentParser(parents=parent_parsers)
self.parser.add_argument(
'-c', '--config', is_config_file=True, default=config_file,
help='Path to a configuration file in YAML format.'
)
self.parser.add_argument(
'-l', '--live-mode', action='store_true', dest='live_mode',
env_var=ENV_LIVE_TEST,
help='Activate "live" recording mode for tests.'
)
self.args = self.parser.parse_args([])
@property
def record_mode(self):
return self.args.live_mode

Просмотреть файл

@ -0,0 +1,14 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# Replaced mock values
MOCKED_SUBSCRIPTION_ID = '00000000-0000-0000-0000-000000000000'
MOCKED_TENANT_ID = '00000000-0000-0000-0000-000000000000'
# Configuration environment variable
ENV_COMMAND_COVERAGE = 'AZURE_TEST_COMMAND_COVERAGE'
ENV_LIVE_TEST = 'AZURE_TEST_RUN_LIVE'
ENV_SKIP_ASSERT = 'AZURE_TEST_SKIP_ASSERT'
ENV_TEST_DIAGNOSE = 'AZURE_TEST_DIAGNOSE'

Просмотреть файл

@ -0,0 +1,44 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import os
import functools
import unittest
from .const import ENV_LIVE_TEST
from .utilities import trim_kwargs_from_test_function
def live_only():
return unittest.skipUnless(
os.environ.get(ENV_LIVE_TEST, False),
'This is a live only test. A live test will bypass all vcrpy components.')
def record_only():
return unittest.skipUnless(
not os.environ.get(ENV_LIVE_TEST, False),
'This test is excluded from being run live. To force a recording, please remove the recording file.')
class AllowLargeResponse(object): # pylint: disable=too-few-public-methods
def __init__(self, size_kb=1024):
self.size_kb = size_kb
def __call__(self, fn):
def _preparer_wrapper(test_class_instance, **kwargs):
from azure_devtools.scenario_tests import LargeResponseBodyProcessor
large_resp_body = next((r for r in test_class_instance.recording_processors
if isinstance(r, LargeResponseBodyProcessor)), None)
if large_resp_body:
large_resp_body._max_response_body = self.size_kb # pylint: disable=protected-access
trim_kwargs_from_test_function(fn, kwargs)
fn(test_class_instance, **kwargs)
setattr(_preparer_wrapper, '__is_preparer', True)
functools.update_wrapper(_preparer_wrapper, fn)
return _preparer_wrapper

Просмотреть файл

@ -0,0 +1,10 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
class AzureTestError(Exception):
def __init__(self, error_message):
message = 'An error caused by the Azure test harness failed the test: {}'
super(AzureTestError, self).__init__(message.format(error_message))

Просмотреть файл

@ -0,0 +1,37 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from .exceptions import AzureTestError
def patch_time_sleep_api(unit_test):
def _time_sleep_skip(*_):
return
mock_in_unit_test(unit_test, 'time.sleep', _time_sleep_skip)
def patch_long_run_operation_delay(unit_test):
def _shortcut_long_run_operation(*args, **kwargs): # pylint: disable=unused-argument
return
mock_in_unit_test(unit_test,
'msrestazure.azure_operation.AzureOperationPoller._delay',
_shortcut_long_run_operation)
def mock_in_unit_test(unit_test, target, replacement):
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest
if not isinstance(unit_test, unittest.TestCase):
raise AzureTestError('Patches can be only called from a unit test')
mp = mock.patch(target, replacement)
mp.__enter__()
unit_test.addCleanup(mp.__exit__)

Просмотреть файл

@ -0,0 +1,122 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import contextlib
import functools
from .base import ReplayableTest
from .utilities import create_random_name, is_text_payload, trim_kwargs_from_test_function
from .recording_processors import RecordingProcessor
# Core Utility
class AbstractPreparer(object):
def __init__(self, name_prefix, name_len, disable_recording=False):
self.name_prefix = name_prefix
self.name_len = name_len
self.resource_moniker = None
self.resource_random_name = None
self.test_class_instance = None
self.live_test = False
self.disable_recording = disable_recording
def __call__(self, fn):
def _preparer_wrapper(test_class_instance, **kwargs):
self.live_test = not isinstance(test_class_instance, ReplayableTest)
self.test_class_instance = test_class_instance
if self.live_test or test_class_instance.in_recording:
resource_name = self.random_name
if not self.live_test and isinstance(self, RecordingProcessor):
test_class_instance.recording_processors.append(self)
else:
resource_name = self.moniker
with self.override_disable_recording():
parameter_update = self.create_resource(
resource_name,
**kwargs
)
if parameter_update:
kwargs.update(parameter_update)
trim_kwargs_from_test_function(fn, kwargs)
try:
fn(test_class_instance, **kwargs)
finally:
# Russian Doll - the last declared resource to be deleted first.
self.remove_resource_with_record_override(resource_name, **kwargs)
setattr(_preparer_wrapper, '__is_preparer', True)
functools.update_wrapper(_preparer_wrapper, fn)
return _preparer_wrapper
@contextlib.contextmanager
def override_disable_recording(self):
if hasattr(self.test_class_instance, 'disable_recording'):
orig_enabled = self.test_class_instance.disable_recording
self.test_class_instance.disable_recording = self.disable_recording
yield
self.test_class_instance.disable_recording = orig_enabled
else:
yield
@property
def moniker(self):
if not self.resource_moniker:
self.test_class_instance.test_resources_count += 1
self.resource_moniker = '{}{:06}'.format(self.name_prefix,
self.test_class_instance.test_resources_count)
return self.resource_moniker
def create_random_name(self):
return create_random_name(self.name_prefix, self.name_len)
@property
def random_name(self):
if not self.resource_random_name:
self.resource_random_name = self.create_random_name()
return self.resource_random_name
def create_resource(self, name, **kwargs): # pylint: disable=unused-argument,no-self-use
return {}
def remove_resource(self, name, **kwargs): # pylint: disable=unused-argument
pass
def remove_resource_with_record_override(self, name, **kwargs):
with self.override_disable_recording():
self.remove_resource(name, **kwargs)
class SingleValueReplacer(RecordingProcessor):
# pylint: disable=no-member
def process_request(self, request):
from six.moves.urllib_parse import quote_plus # pylint: disable=import-error,relative-import
if self.random_name in request.uri:
request.uri = request.uri.replace(self.random_name, self.moniker)
elif quote_plus(self.random_name) in request.uri:
request.uri = request.uri.replace(quote_plus(self.random_name),
quote_plus(self.moniker))
if is_text_payload(request) and request.body:
body = str(request.body, 'utf-8') if isinstance(request.body, bytes) else str(request.body)
if self.random_name in body:
request.body = body.replace(self.random_name, self.moniker)
return request
def process_response(self, response):
if is_text_payload(response) and response['body']['string']:
response['body']['string'] = response['body']['string'].replace(self.random_name,
self.moniker)
self.replace_header(response, 'location', self.random_name, self.moniker)
self.replace_header(response, 'azure-asyncoperation', self.random_name, self.moniker)
return response

Просмотреть файл

@ -0,0 +1,200 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from .utilities import is_text_payload, is_json_payload
class RecordingProcessor(object):
def process_request(self, request): # pylint: disable=no-self-use
return request
def process_response(self, response): # pylint: disable=no-self-use
return response
@classmethod
def replace_header(cls, entity, header, old, new):
cls.replace_header_fn(entity, header, lambda v: v.replace(old, new))
@classmethod
def replace_header_fn(cls, entity, header, replace_fn):
# Loop over the headers to find the one we want case insensitively,
# but we don't want to modify the case of original header key.
for key, values in entity['headers'].items():
if key.lower() == header.lower():
entity['headers'][key] = [replace_fn(v) for v in values]
class SubscriptionRecordingProcessor(RecordingProcessor):
def __init__(self, replacement):
self._replacement = replacement
def process_request(self, request):
request.uri = self._replace_subscription_id(request.uri)
if is_text_payload(request) and request.body:
request.body = self._replace_subscription_id(request.body.decode()).encode()
return request
def process_response(self, response):
if is_text_payload(response) and response['body']['string']:
response['body']['string'] = self._replace_subscription_id(response['body']['string'])
self.replace_header_fn(response, 'location', self._replace_subscription_id)
self.replace_header_fn(response, 'azure-asyncoperation', self._replace_subscription_id)
return response
def _replace_subscription_id(self, val):
import re
# subscription presents in all api call
retval = re.sub('/(subscriptions)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
r'/\1/{}'.format(self._replacement),
val,
flags=re.IGNORECASE)
# subscription is also used in graph call
retval = re.sub('https://(graph.windows.net)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
r'https://\1/{}'.format(self._replacement),
retval,
flags=re.IGNORECASE)
return retval
class LargeRequestBodyProcessor(RecordingProcessor):
def __init__(self, max_request_body=128):
self._max_request_body = max_request_body
def process_request(self, request):
if is_text_payload(request) and request.body and len(request.body) > self._max_request_body * 1024:
request.body = '!!! The request body has been omitted from the recording because its ' \
'size {} is larger than {}KB. !!!'.format(len(request.body),
self._max_request_body)
return request
class LargeResponseBodyProcessor(RecordingProcessor):
control_flag = '<CTRL-REPLACE>'
def __init__(self, max_response_body=128):
self._max_response_body = max_response_body
def process_response(self, response):
if is_text_payload(response):
length = len(response['body']['string'] or '')
if length > self._max_response_body * 1024:
if is_json_payload(response):
from .decorators import AllowLargeResponse # pylint: disable=cyclic-import
raise ValueError("The json response body exceeds the default limit of {}kb. Use '@{}' "
"on your test method to increase the limit or update test logics to avoid "
"big payloads".format(self._max_response_body, AllowLargeResponse.__name__))
response['body']['string'] = \
"!!! The response body has been omitted from the recording because it is larger " \
"than {} KB. It will be replaced with blank content of {} bytes while replay. " \
"{}{}".format(self._max_response_body, length, self.control_flag, length)
return response
class LargeResponseBodyReplacer(RecordingProcessor):
def process_response(self, response):
if is_text_payload(response) and not is_json_payload(response):
import six
body = response['body']['string']
# backward compatibility. under 2.7 response body is unicode, under 3.5 response body is
# bytes. when set the value back, the same type must be used.
body_is_string = isinstance(body, six.string_types)
content_in_string = (response['body']['string'] or b'').decode('utf-8')
index = content_in_string.find(LargeResponseBodyProcessor.control_flag)
if index > -1:
length = int(content_in_string[index + len(LargeResponseBodyProcessor.control_flag):])
if body_is_string:
response['body']['string'] = '0' * length
else:
response['body']['string'] = bytes([0] * length)
return response
class OAuthRequestResponsesFilter(RecordingProcessor):
"""Remove oauth authentication requests and responses from recording."""
def process_request(self, request):
# filter request like:
# GET https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token
# POST https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token
import re
if not re.match('https://login.microsoftonline.com/([^/]+)/oauth2(?:/v2.0)?/token', request.uri):
return request
return None
class DeploymentNameReplacer(RecordingProcessor):
"""Replace the random deployment name with a fixed mock name."""
def process_request(self, request):
import re
request.uri = re.sub('/deployments/([^/?]+)', '/deployments/mock-deployment', request.uri)
return request
class AccessTokenReplacer(RecordingProcessor):
"""Replace the access token for service principal authentication in a response body."""
def __init__(self, replacement='fake_token'):
self._replacement = replacement
def process_response(self, response):
import json
try:
body = json.loads(response['body']['string'])
body['access_token'] = self._replacement
except (KeyError, ValueError):
return response
response['body']['string'] = json.dumps(body)
return response
class GeneralNameReplacer(RecordingProcessor):
def __init__(self):
self.names_name = []
def register_name_pair(self, old, new):
self.names_name.append((old, new))
def process_request(self, request):
for old, new in self.names_name:
request.uri = request.uri.replace(old, new)
if is_text_payload(request) and request.body:
body = str(request.body)
if old in body:
request.body = body.replace(old, new)
return request
def process_response(self, response):
for old, new in self.names_name:
if is_text_payload(response) and response['body']['string']:
response['body']['string'] = response['body']['string'].replace(old, new)
self.replace_header(response, 'location', old, new)
self.replace_header(response, 'azure-asyncoperation', old, new)
return response
class RequestUrlNormalizer(RecordingProcessor):
"""URL parsing fix to account for '//' vs '/' in different versions of python"""
def process_request(self, request):
import re
request.uri = re.sub('(?<!:)//', '/', request.uri)
return request

Просмотреть файл

@ -0,0 +1,4 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -0,0 +1,36 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import os
import tempfile
import unittest
try:
import mock
except ImportError:
from unittest import mock
from azure_devtools.scenario_tests.const import ENV_LIVE_TEST
class TestScenarioConfig(unittest.TestCase):
def setUp(self):
with tempfile.NamedTemporaryFile(mode='w', delete=False) as cfgfile:
cfgfile.write('live-mode: yes')
self.cfgfile = cfgfile.name
def tearDown(self):
os.remove(self.cfgfile)
def test_env_var(self):
from azure_devtools.scenario_tests.config import TestConfig
with mock.patch.dict('os.environ', {ENV_LIVE_TEST: 'yes'}):
config = TestConfig()
self.assertIs(config.record_mode, True)
def test_config_file(self):
from azure_devtools.scenario_tests.config import TestConfig
config = TestConfig(config_file=self.cfgfile)
self.assertIs(config.record_mode, True)

Просмотреть файл

@ -0,0 +1,58 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import os
import unittest
from azure_devtools.scenario_tests.base import IntegrationTestBase, LiveTest
class TestIntegrationTestBase(unittest.TestCase):
def test_integration_test_default_constructor(self):
class MockTest(IntegrationTestBase):
def __init__(self):
super(MockTest, self).__init__('sample_test')
def sample_test(self):
pass
tb = MockTest()
random_name = tb.create_random_name('example', 90)
self.assertEqual(len(random_name), 90)
self.assertTrue(random_name.startswith('example'))
random_file = tb.create_temp_file(size_kb=16, full_random=False)
self.addCleanup(lambda: os.remove(random_file))
self.assertTrue(os.path.isfile(random_file))
self.assertEqual(os.path.getsize(random_file), 16 * 1024)
self.assertEqual(len(tb._cleanups), 1) # pylint: disable=protected-access
with open(random_file, 'rb') as fq:
# the file is blank
self.assertFalse(any(b for b in fq.read(16 * 1024) if b != '\x00'))
random_file_2 = tb.create_temp_file(size_kb=8, full_random=True)
self.addCleanup(lambda: os.remove(random_file_2))
self.assertTrue(os.path.isfile(random_file_2))
self.assertEqual(os.path.getsize(random_file_2), 8 * 1024)
self.assertEqual(len(tb._cleanups), 2) # pylint: disable=protected-access
with open(random_file_2, 'rb') as fq:
# the file is blank
self.assertTrue(any(b for b in fq.read(8 * 1024) if b != '\x00'))
random_dir = tb.create_temp_dir()
self.addCleanup(lambda: os.rmdir(random_dir))
self.assertTrue(os.path.isdir(random_dir))
self.assertEqual(len(tb._cleanups), 3) # pylint: disable=protected-access
def test_live_test_default_constructor(self):
class MockTest(LiveTest):
def __init__(self):
super(MockTest, self).__init__('sample_test')
def sample_test(self):
pass
self.assertIsNone(MockTest().run(), 'The live test is not skipped as expected')

Просмотреть файл

@ -0,0 +1,42 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import unittest
from azure_devtools.scenario_tests.preparers import AbstractPreparer
traces = []
class _TestPreparer(AbstractPreparer):
def __init__(self, name):
super(_TestPreparer, self).__init__('test', 20)
self._name = name
def create_resource(self, name, **kwargs):
traces.append('create ' + self._name)
return {}
def remove_resource(self, name, **kwargs):
traces.append('remove ' + self._name)
class _TestClassSample(unittest.TestCase):
@_TestPreparer('A')
@_TestPreparer('B')
def example_test(self):
pass
def test_preparer_order():
# Mimic a real test runner, for better compat 2.7 / 3.x
suite = unittest.TestSuite()
suite.addTest(_TestClassSample('example_test'))
unittest.TextTestRunner().run(suite)
assert len(traces) == 4
assert traces[0] == 'create A'
assert traces[1] == 'create B'
assert traces[2] == 'remove B'
assert traces[3] == 'remove A'

Просмотреть файл

@ -0,0 +1,141 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import json
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest
import uuid
from azure_devtools.scenario_tests.recording_processors import (
RecordingProcessor, SubscriptionRecordingProcessor, AccessTokenReplacer
)
class TestRecordingProcessors(unittest.TestCase):
def test_recording_processor_base_class(self):
rp = RecordingProcessor()
request_sample = {'url': 'https://www.bing,com', 'headers': {'beta': ['value_1', 'value_2']}}
response_sample = {'body': 'something', 'headers': {'charlie': ['value_3']}}
self.assertIs(request_sample, rp.process_request(request_sample)) # reference equality
self.assertIs(response_sample, rp.process_response(response_sample))
rp.replace_header(request_sample, 'beta', 'value_1', 'replaced_1')
self.assertSequenceEqual(request_sample['headers']['beta'], ['replaced_1', 'value_2'])
rp.replace_header(request_sample, 'Beta', 'replaced_1', 'replaced_2') # case insensitive
self.assertSequenceEqual(request_sample['headers']['beta'], ['replaced_2', 'value_2'])
rp.replace_header(request_sample, 'alpha', 'replaced_1', 'replaced_2') # ignore KeyError
self.assertSequenceEqual(request_sample['headers']['beta'], ['replaced_2', 'value_2'])
rp.replace_header_fn(request_sample, 'beta', lambda v: 'customized')
self.assertSequenceEqual(request_sample['headers']['beta'], ['customized', 'customized'])
def test_access_token_processor(self):
replaced_subscription_id = 'test_fake_token'
rp = AccessTokenReplacer(replaced_subscription_id)
TOKEN_STR = '{"token_type": "Bearer", "resource": "url", "access_token": "real_token"}'
token_response_sample = {'body': {'string': TOKEN_STR}}
self.assertEqual(json.loads(rp.process_response(token_response_sample)['body']['string'])['access_token'],
replaced_subscription_id)
no_token_response_sample = {'body': {'string': '{"location": "westus"}'}}
self.assertDictEqual(rp.process_response(no_token_response_sample), no_token_response_sample)
@staticmethod
def _mock_subscription_request_body(mock_sub_id):
return json.dumps({
"location": "westus",
"properties": {
"ipConfigurations": [
{
"properties": {
"subnet": {"id": "/Subscriptions/{}/resourceGroups/etc".format(mock_sub_id)},
"name": "azure-sample-ip-config"
}
},
]
}
}).encode()
def test_subscription_recording_processor_for_request(self):
replaced_subscription_id = str(uuid.uuid4())
rp = SubscriptionRecordingProcessor(replaced_subscription_id)
uri_templates = ['https://management.azure.com/subscriptions/{}/providers/Microsoft.ContainerRegistry/'
'checkNameAvailability?api-version=2017-03-01',
'https://graph.windows.net/{}/applications?api-version=1.6']
for template in uri_templates:
mock_sub_id = str(uuid.uuid4())
mock_request = mock.Mock()
mock_request.uri = template.format(mock_sub_id)
mock_request.body = self._mock_subscription_request_body(mock_sub_id)
mock_request.headers = {'content-type': 'application/json'}
rp.process_request(mock_request)
self.assertEqual(mock_request.uri, template.format(replaced_subscription_id))
self.assertEqual(mock_request.body,
self._mock_subscription_request_body(replaced_subscription_id))
def test_subscription_recording_processor_for_response(self):
replaced_subscription_id = str(uuid.uuid4())
rp = SubscriptionRecordingProcessor(replaced_subscription_id)
body_templates = ['https://management.azure.com/subscriptions/{}/providers/Microsoft.ContainerRegistry/'
'checkNameAvailability?api-version=2017-03-01',
'https://graph.Windows.net/{}/applications?api-version=1.6',
"{{'scope':'/subscriptions/{}', 'another_data':'/Microsoft.Something'}}"]
location_header_template = 'https://graph.windows.net/{}/directoryObjects/' \
'f604c53a-aa21-44d5-a41f-c1ef0b5304bd/Microsoft.DirectoryServices.Application'
asyncoperation_header_template = 'https://management.azure.com/subscriptions/{}/resourceGroups/' \
'clitest.rg000001/providers/Microsoft.Sql/servers/clitestserver000002/' \
'databases/cliautomationdb01/azureAsyncOperation/' \
'6ec6196b-fbaa-415f-8c1a-6cb634a96cb2?api-version=2014-04-01-Preview'
for template in body_templates:
mock_sub_id = str(uuid.uuid4())
mock_response = dict({'body': {}})
mock_response['body']['string'] = template.format(mock_sub_id)
mock_response['headers'] = {'Location': [location_header_template.format(mock_sub_id)],
'azure-asyncoperation': [asyncoperation_header_template.format(mock_sub_id)],
'content-type': ['application/json']}
rp.process_response(mock_response)
self.assertEqual(mock_response['body']['string'], template.format(replaced_subscription_id))
self.assertSequenceEqual(mock_response['headers']['Location'],
[location_header_template.format(replaced_subscription_id)])
self.assertSequenceEqual(mock_response['headers']['azure-asyncoperation'],
[asyncoperation_header_template.format(replaced_subscription_id)])
def test_recording_processor_skip_body_on_unrecognized_content_type(self):
location_header_template = 'https://graph.windows.net/{}/directoryObjects/' \
'f604c53a-aa21-44d5-a41f-c1ef0b5304bd/Microsoft.DirectoryServices.Application'
replaced_subscription_id = str(uuid.uuid4())
rp = SubscriptionRecordingProcessor(replaced_subscription_id)
mock_sub_id = str(uuid.uuid4())
mock_response = dict({'body': {}})
mock_response['body']['string'] = mock_sub_id
mock_response['headers'] = {
'Location': [location_header_template.format(mock_sub_id)],
'content-type': ['application/foo']
}
# action
rp.process_response(mock_response)
# assert
self.assertEqual(mock_response['body']['string'], mock_sub_id) # body unchanged
self.assertEqual(mock_response['headers']['Location'],
[location_header_template.format(replaced_subscription_id)]) # header changed

Просмотреть файл

@ -0,0 +1,121 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import unittest
try:
from unittest import mock
except ImportError:
import mock
from azure_devtools.scenario_tests.utilities import (create_random_name, get_sha1_hash,
is_text_payload, is_json_payload)
class TestUtilityFunctions(unittest.TestCase):
def test_create_random_name_default_value(self):
default_generated_name = create_random_name()
self.assertTrue(default_generated_name.startswith('aztest'))
self.assertEqual(24, len(default_generated_name))
self.assertTrue(isinstance(default_generated_name, str))
def test_create_random_name_randomness(self):
self.assertEqual(100, len(set([create_random_name() for _ in range(100)])))
def test_create_random_name_customization(self):
customized_name = create_random_name(prefix='pauline', length=61)
self.assertTrue(customized_name.startswith('pauline'))
self.assertEqual(61, len(customized_name))
self.assertTrue(isinstance(customized_name, str))
def test_create_random_name_exception_long_prefix(self):
prefix = 'prefix-too-long'
with self.assertRaises(ValueError) as cm:
create_random_name(prefix, length=len(prefix)-1)
self.assertEqual(str(cm.exception), 'The length of the prefix must not be longer than random name length')
self.assertTrue(create_random_name(prefix, length=len(prefix)+4).startswith(prefix))
def test_create_random_name_exception_not_enough_space_for_randomness(self):
prefix = 'prefix-too-long'
for i in range(4):
with self.assertRaises(ValueError) as cm:
create_random_name(prefix, length=len(prefix) + i)
self.assertEqual(str(cm.exception), 'The randomized part of the name is shorter than 4, which may not be '
'able to offer enough randomness')
def test_get_sha1_hash(self):
import tempfile
with tempfile.NamedTemporaryFile() as f:
content = b"""
All the world's a stage,
And all the men and women merely players;
They have their exits and their entrances,
And one man in his time plays many parts,
His acts being seven ages. At first, the infant,
Mewling and puking in the nurse's arms.
Then the whining schoolboy, with his satchel
And shining morning face, creeping like snail
Unwillingly to school. And then the lover,
Sighing like furnace, with a woeful ballad
Made to his mistress' eyebrow. Then a soldier,
Full of strange oaths and bearded like the pard,
Jealous in honor, sudden and quick in quarrel,
Seeking the bubble reputation
Even in the cannon's mouth. And then the justice,
In fair round belly with good capon lined,
With eyes severe and beard of formal cut,
Full of wise saws and modern instances;
And so he plays his part. The sixth age shifts
Into the lean and slippered pantaloon,
With spectacles on nose and pouch on side;
His youthful hose, well saved, a world too wide
For his shrunk shank, and his big manly voice,
Turning again toward childish treble, pipes
And whistles in his sound. Last scene of all,
That ends this strange eventful history,
Is second childishness and mere oblivion,
Sans teeth, sans eyes, sans taste, sans everything.
William Shakespeare
"""
f.write(content)
f.seek(0)
hash_value = get_sha1_hash(f.name)
self.assertEqual('6487bbdbd848686338d729e6076da1a795d1ae747642bf906469c6ccd9e642f9', hash_value)
def test_text_payload(self):
http_entity = mock.MagicMock()
headers = {}
http_entity.headers = headers
headers['content-type'] = 'foo/'
self.assertFalse(is_text_payload(http_entity))
headers['content-type'] = 'text/html; charset=utf-8'
self.assertTrue(is_text_payload(http_entity))
headers['content-type'] = 'APPLICATION/JSON; charset=utf-8'
self.assertTrue(is_text_payload(http_entity))
headers['content-type'] = 'APPLICATION/xml'
self.assertTrue(is_text_payload(http_entity))
http_entity.headers = None # default to text mode if there is no header
self.assertTrue(is_text_payload(http_entity))
def test_json_payload(self):
http_entity = mock.MagicMock()
headers = {}
http_entity.headers = headers
headers['content-type'] = 'APPLICATION/JSON; charset=utf-8'
self.assertTrue(is_json_payload(http_entity))
headers['content-type'] = 'application/json; charset=utf-8'
self.assertTrue(is_json_payload(http_entity))
headers['content-type'] = 'application/xml; charset=utf-8'
self.assertFalse(is_json_payload(http_entity))

Просмотреть файл

@ -0,0 +1,81 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import hashlib
import math
import os
import base64
import inspect
def create_random_name(prefix='aztest', length=24):
if len(prefix) > length:
raise ValueError('The length of the prefix must not be longer than random name length')
padding_size = length - len(prefix)
if padding_size < 4:
raise ValueError('The randomized part of the name is shorter than 4, which may not be able to offer enough '
'randomness')
random_bytes = os.urandom(int(math.ceil(float(padding_size) / 8) * 5))
random_padding = base64.b32encode(random_bytes)[:padding_size]
return str(prefix + random_padding.decode().lower())
def get_sha1_hash(file_path):
sha1 = hashlib.sha256()
with open(file_path, 'rb') as f:
while True:
data = f.read(65536)
if not data:
break
sha1.update(data)
return sha1.hexdigest()
def _get_content_type(entity):
# 'headers' is a field of 'request', but it is a dict-key in 'response'
headers = getattr(entity, 'headers', None)
if headers is None:
headers = entity.get('headers')
content_type = None
if headers:
content_type = headers.get('content-type', None)
if content_type:
# content-type could an array from response, let us extract it out
content_type = content_type[0] if isinstance(content_type, list) else content_type
content_type = content_type.split(";")[0].lower()
return content_type
def is_text_payload(entity):
text_content_list = ['application/json', 'application/xml', 'text/', 'application/test-content']
content_type = _get_content_type(entity)
if content_type:
return any(content_type.startswith(x) for x in text_content_list)
return True
def is_json_payload(entity):
return _get_content_type(entity) == 'application/json'
def trim_kwargs_from_test_function(fn, kwargs):
# the next function is the actual test function. the kwargs need to be trimmed so
# that parameters which are not required will not be passed to it.
if not is_preparer_func(fn):
args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method
if kw is None:
args = set(args)
for key in [k for k in kwargs if k not in args]:
del kwargs[key]
def is_preparer_func(fn):
return getattr(fn, '__is_preparer', False)

Просмотреть файл

@ -0,0 +1 @@
-e ../azure-devtools