Permalink
Browse files

Merge branch 'master' into on_error#128

  • Loading branch information...
spaceone committed Feb 17, 2017
2 parents bccfe7f + 1b69122 commit cc19ac1c194883e88b327a742946f8ac379ab419
Showing with 22 additions and 16 deletions.
  1. +1 −1 README.md
  2. +1 −1 README.rst
  3. +3 −1 circuits/web/errors.py
  4. +2 −2 examples/dnsclient.py
  5. +1 −0 requirements-test.txt
  6. +13 −11 tests/core/test_call_wait.py
  7. +1 −0 tox.ini
View
@@ -93,4 +93,4 @@ There are also several places you can reach out to the circuits community:
Disclaimer
==========
-Whilst I (James Mills) continue to contribute and maintain the circuits project I do not represent the interests or business of my employer Facebook Inc. The contributions I make are of my own free time and have no bearing or relevance o Facebook Inc.
+Whilst I (James Mills) continue to contribute and maintain the circuits project I do not represent the interests or business of my employer Facebook Inc. The contributions I make are of my own free time and have no bearing or relevance to Facebook Inc.
View
@@ -139,4 +139,4 @@ Disclaimer
Whilst I (James Mills) continue to contribute and maintain the circuits project
I do not represent the interests or business of my employer Facebook Inc. The
contributions I make are of my own free time and have no bearing or relevance
-o Facebook Inc.
+to Facebook Inc.
View
@@ -162,7 +162,7 @@ def __init__(self, request, response, urls, code=None):
super(redirect, self).__init__(request, response, code)
- if code in (300, 301, 302, 303, 307):
+ if code in (300, 301, 302, 303, 307, 308):
response.headers["Content-Type"] = "text/html"
# "The ... URI SHOULD be given by the Location field
# in the response."
@@ -180,6 +180,8 @@ def __init__(self, request, response, urls, code=None):
"<a href='%s'>%s</a>."),
307: ("This resource has moved temporarily to "
"<a href='%s'>%s</a>."),
+ 308: ("This resource has permanently moved to "
+ "<a href='%s'>%s</a>."),
}[code]
response.body = "<br />\n".join([msg % (u, u) for u in urls])
# Previous code may have set C-L, so we have to reset it
View
@@ -7,7 +7,7 @@
deconstruction (*a really nice library btw with
great integration into circuits*).
-Specify the server, port and query as argumetns
+Specify the server, port, and query as arguments
to perform a lookup against a server using UDP.
To run this example::
@@ -69,7 +69,7 @@ class DNSClient(Component):
"""DNS Client
This ties everything together in a nice
- configurable way with protocol, transport
+ configurable way with protocol, transport,
and dummy handler as well as optional debugger.
"""
View
@@ -1,6 +1,7 @@
codecov
pytest
pytest-cov
+pytest-timeout
flake8
isort
tox
@@ -5,67 +5,56 @@
class wait(Event):
-
"""wait Event"""
success = True
class call(Event):
-
"""call Event"""
success = True
class long_call(Event):
-
"""long_call Event"""
success = True
class long_wait(Event):
-
"""long_wait Event"""
success = True
class wait_return(Event):
-
"""wait_return Event"""
success = True
class hello(Event):
-
"""hello Event"""
success = True
class foo(Event):
-
"""foo Event"""
success = True
class get_x(Event):
-
"""get_x Event"""
success = True
class get_y(Event):
-
"""get_y Event"""
success = True
class eval(Event):
-
"""eval Event"""
success = True
class App(Component):
-
@handler("wait")
def _on_wait(self):
x = self.fire(hello())
@@ -168,3 +157,16 @@ def test_eval(manager, watcher, app):
value = x.value
assert value == 3
+
+
+@pytest.mark.xfail(reason='Issue #226')
+@pytest.mark.timeout(1)
+def test_wait_too_late(manager, watcher, app):
+ event = foo()
+ manager.fire(event)
+ assert watcher.wait("foo_success")
+ manager.tick()
+
+ x = manager.wait(event, timeout=.1)
+ value = next(x)
+ assert value == list(range(1, 10))
View
@@ -10,6 +10,7 @@ commands=py.test {posargs}
deps=
pytest
pytest-cov
+ pytest-timeout
[testenv:docs]
basepython=python

0 comments on commit cc19ac1

Please sign in to comment.