Skip to content

Commit

Permalink
Remove config.default.json from resources unittest.
Browse files Browse the repository at this point in the history
Instead we slightly hackily import serve and read the config from there.
But that isn't a great approach because we allow the defaults to be overridden.
A better fix here would stop shelling out to create the server and call the
code directly, reading the resolved config.
  • Loading branch information
jgraham committed May 8, 2018
1 parent a1c034e commit 5ba8d1c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions resources/test/wptserver.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import json
import os
import subprocess
import time
import sys
import urllib2


class WPTServer(object):

def __init__(self, wpt_root):
self.wpt_root = wpt_root
config_file = os.path.join(wpt_root, 'config.default.json')
with open(config_file, 'rb') as config_handle:
config = json.load(config_handle)
sys.path.insert(0, os.path.join(wpt_root, "tools"))
from serve.serve import Config
config = Config()
self.host = config["browser_host"]
self.http_port = config["ports"]["http"][0]
self.https_port = config["ports"]["https"][0]
Expand Down

0 comments on commit 5ba8d1c

Please sign in to comment.