Fix github driver tests for py3

Urllib needs bytes for POST data.

Change-Id: I5cab622c50dbc50892526416944f52a8cd4364a7
This commit is contained in:
Clint Byrum 2017-05-18 12:05:13 -07:00
parent 8897dca29b
commit 607d10e1d9
2 changed files with 5 additions and 5 deletions

View File

@ -840,7 +840,7 @@ class FakeGithubConnection(githubconnection.GithubConnection):
"""Emulates sending the GitHub webhook event to the connection."""
port = self.webapp.server.socket.getsockname()[1]
name, data = event
payload = json.dumps(data)
payload = json.dumps(data).encode('utf8')
headers = {'X-Github-Event': name}
req = urllib.request.Request(
'http://localhost:%s/connection/%s/payload'

View File

@ -14,10 +14,10 @@
from zuul.driver import Driver, ConnectionInterface, TriggerInterface
from zuul.driver import SourceInterface
import githubconnection
import githubtrigger
import githubsource
import githubreporter
from zuul.driver.github import githubconnection
from zuul.driver.github import githubtrigger
from zuul.driver.github import githubsource
from zuul.driver.github import githubreporter
class GithubDriver(Driver, ConnectionInterface, TriggerInterface,