-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from MasoniteFramework/develop
Next Minor
- Loading branch information
Showing
26 changed files
with
228 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
class SubController: | ||
|
||
def show(self): | ||
return 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""Module for specifying the Masonite version in a central location.""" | ||
|
||
VERSION = '2.1.1' | ||
VERSION = '2.1.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ShouldQueue: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .Queueable import Queueable | ||
from .ShouldQueue import ShouldQueue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from masonite.app import App | ||
from masonite.drivers import QueueAsyncDriver, QueueAmqpDriver | ||
from masonite.managers import QueueManager | ||
from config import queue | ||
|
||
from masonite.queues.Queueable import Queueable | ||
import os | ||
from masonite.environment import LoadEnvironment, env | ||
|
||
LoadEnvironment() | ||
|
||
|
||
class Job(Queueable): | ||
|
||
def handle(self): | ||
print('sending from job handled') | ||
return 'test' | ||
|
||
class Random(Queueable): | ||
|
||
def send(self): | ||
print('sending from random send method') | ||
return 'test' | ||
|
||
def handle(self): | ||
print('sending from random handle method') | ||
return 'test' | ||
|
||
|
||
class TestAsyncDriver: | ||
|
||
def setup_method(self): | ||
self.app = App() | ||
|
||
self.app.bind('QueueAsyncDriver', QueueAsyncDriver) | ||
self.app.bind('QueueAmqpDriver', QueueAmqpDriver) | ||
self.app.bind('QueueConfig', queue) | ||
self.app.bind('Queueable', Queueable) | ||
self.app.bind('Container', self.app) | ||
self.app.bind('QueueManager', QueueManager(self.app)) | ||
self.drivers = ['async'] | ||
if env('RUN_AMQP'): | ||
self.drivers.append('amqp') | ||
|
||
def test_async_driver_pushes_to_queue(self): | ||
for driver in self.drivers: | ||
assert self.app.make('QueueManager').driver(driver).push(Job) is None | ||
|
||
def test_async_driver_can_run_any_callback_method(self): | ||
for driver in self.drivers: | ||
assert self.app.make('QueueManager').driver(driver).push(Random, callback="send") is None | ||
|
||
def test_async_driver_can_run_any_method(self): | ||
for driver in self.drivers: | ||
assert self.app.make('QueueManager').driver(driver).push(Random().send) is None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.