Repository: MasoniteFramework/core

Issue:
Change how making an object from the container resolves
The entire point of a service container is to manage application dependencies automatically.

If i have an object like this:

```python
class Mail:

    def __init__(self, request: Request, mail: Mail):
        self.request = request
```

i should be able to load this class into the container and have it resolve dependencies when I make the class from the container at that time.

For example, I should be able to do this:

```python
app.bind('Mail', Mail)

mail = app.make('Mail').request == Request
```

So the class is actually initialized WHEN the class is retrieved from the container.

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77c5f67..8cc2c29 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Sentimental Versioning](http://sentimentalversioning.org/).
 
+## [2.1.26](https://github.com/MasoniteFramework/core/releases/tag/v2.1.26) - 2019-03-31
+### Fixed
+- Fixed issue where channel was not reopening after closing for AMQP driver
+
+## [2.1.25](https://github.com/MasoniteFramework/core/releases/tag/v2.1.25) - 2019-03-31
+### Fixed
+- Fixed issue where the amqp driver was not closing connections and channels after use
+
+## [2.1.24](https://github.com/MasoniteFramework/core/releases/tag/v2.1.24) - 2019-03-31
+### Fixed
+- Fixed issue where queue jobs would fail because of a Unicode character (the checkmark) being printed out which would cause the job to fail. Now the command will print out a [Y] character if it cannot print out of a check mark.
+
 ## [2.1.23](https://github.com/MasoniteFramework/core/releases/tag/v2.1.23) - 2019-03-24
 ### Added
 - [Added Cors middleware](https://docs.masoniteproject.com/security/headers#cors).
diff --git a/masonite/app.py b/masonite/app.py
index 62ec7fa..85325f5 100644
--- a/masonite/app.py
+++ b/masonite/app.py
@@ -61,6 +61,10 @@ class App:
         self.bind(obj if inspect.isclass(obj) else obj.__class__, obj)
         return self
 
+    def singleton(self, name, class_obj):
+        obj = self.resolve(class_obj)
+        self.bind(name, obj)
+
     def make(self, name):
         """Retrieve a class from the container by key.
 
@@ -73,15 +77,20 @@ class App:
         Returns:
             object -- Returns the object that is fetched.
         """
+
         if name in self.providers:
             obj = self.providers[name]
             self.fire_hook('make', name, obj)
+            if inspect.isclass(obj):
+                obj = self.resolve(obj)
             return obj
         elif name in self.swaps:
             return self.swaps[name]
         elif inspect.isclass(name):
             obj = self._find_obj(name)
             self.fire_hook('make', name, obj)
+            if inspect.isclass(obj):
+                obj = self.resolve(obj)
             return obj
 
         raise MissingContainerBindingNotFound(
@@ -133,7 +142,14 @@ class App:
 
         for _, value in self.get_parameters(obj):
             if ':' in str(value):
-                provider_list.append(self._find_annotated_parameter(value))
+                param = self._find_annotated_parameter(value)
+                if inspect.isclass(param):
+                    param = self.resolve(param)
+                provider_list.append(param)
+            elif '=' in str(value):
+                provider_list.append(value.default)
+            elif '*' in str(value):
+                continue
             elif self.resolve_parameters:
                 provider_list.append(self._find_parameter(value))
             elif resolving_arguments:
@@ -226,11 +242,11 @@ class App:
     def get_parameters(self, obj):
         return inspect.signature(obj).parameters.items()
 
-    def _find_parameter(self, parameter):
+    def _find_parameter(self, keyword):
         """Find a parameter in the container.
 
         Arguments:
-            parameter {string} -- Parameter to search for.
+            parameter {inspect.Paramater} -- Parameter to search for.
 
         Raises:
             ContainerError -- Thrown when the dependency is not found in the container.
@@ -238,13 +254,17 @@ class App:
         Returns:
             object -- Returns the object found in the container
         """
-        parameter = str(parameter)
+        parameter = str(keyword)
+
         if parameter != 'self' and parameter in self.providers:
             obj = self.providers[parameter]
             self.fire_hook('resolve', parameter, obj)
             return obj
+        elif '=' in parameter:
+            return keyword.default
+
         raise ContainerError(
-            'The dependency with the key of {0} could not be found in the container'.format(
+            'The parameter dependency with the key of {0} could not be found in the container'.format(
                 parameter)
         )
 
@@ -303,7 +323,7 @@ class App:
                 inspect.isclass(obj) and \
                 obj in self._hooks[action] or obj.__class__ in self._hooks[action]:
 
-            for hook, hook_list in self._hooks[action].items():
+            for _, hook_list in self._hooks[action].items():
                 for hook_obj in hook_list:
                     hook_obj(obj, self)
 
diff --git a/masonite/drivers/upload/BaseUploadDriver.py b/masonite/drivers/upload/BaseUploadDriver.py
index dedf652..830c4fb 100644
--- a/masonite/drivers/upload/BaseUploadDriver.py
+++ b/masonite/drivers/upload/BaseUploadDriver.py
@@ -4,6 +4,7 @@ import _io
 from masonite.drivers import BaseDriver
 from masonite.exceptions import FileTypeException
 from masonite.helpers import random_string
+from masonite.helpers import config
 
 
 class BaseUploadDriver(BaseDriver):
@@ -55,11 +56,11 @@ class BaseUploadDriver(BaseDriver):
             string -- Returns the location it uploaded to.
         """
         if not location:
-            location = self.config.DRIVERS['disk']['location']
+            location = config('storage.drivers.disk.location')
 
         if '.' in location:
             location = location.split('.')
-            return self.config.DRIVERS[location[0]]['location'][location[1]]
+            return config('storage.drivers')[location[0]]['location'][location[1]]
         elif isinstance(location, str):
             return location
         elif isinstance(location, dict):
diff --git a/masonite/drivers/upload/UploadDiskDriver.py b/masonite/drivers/upload/UploadDiskDriver.py
index 0b17ea7..7162996 100644
--- a/masonite/drivers/upload/UploadDiskDriver.py
+++ b/masonite/drivers/upload/UploadDiskDriver.py
@@ -7,6 +7,7 @@ from masonite.contracts import UploadContract
 from masonite.drivers import BaseUploadDriver
 from masonite.helpers.filesystem import make_directory
 from masonite.app import App
+from masonite.helpers import config
 
 
 class UploadDiskDriver(BaseUploadDriver, UploadContract):
@@ -14,15 +15,10 @@ class UploadDiskDriver(BaseUploadDriver, UploadContract):
 
     file_location = None
 
-    def __init__(self, app: App):
+    def __init__(self):
         """Upload Disk Driver Constructor.
-
-        Arguments:
-            StorageConfig {config.storage} -- Storage configuration.
-            Application {masonite.app.App} -- The application container.
         """
-        self.config = app.make('StorageConfig')
-        self.appconfig = app.make('Application')
+        pass
 
     def store(self, fileitem, filename=None, location=None):
         """Store the file onto a server.
diff --git a/masonite/exception_handler.py b/masonite/exception_handler.py
index 4fdc4a1..8c8e536 100644
--- a/masonite/exception_handler.py
+++ b/masonite/exception_handler.py
@@ -53,7 +53,7 @@ class ExceptionHandler:
 
         if self._app.has('Exception{}Handler'.format(exception.__class__.__name__)):
 
-            return self._app.resolve(self._app.make('Exception{}Handler'.format(exception.__class__.__name__))).handle(exception)
+            return self._app.make('Exception{}Handler'.format(exception.__class__.__name__)).handle(exception)
 
         self.handle(exception)
 
diff --git a/masonite/helpers/structures.py b/masonite/helpers/structures.py
index 7815972..458c4a6 100644
--- a/masonite/helpers/structures.py
+++ b/masonite/helpers/structures.py
@@ -26,6 +26,7 @@ class Dot:
             return dictionary[search]
 
         searching = search.split('.')
+        possible = None
         while len(searching) > 0:
             dic = dictionary
             for search in searching:
@@ -33,11 +34,19 @@ class Dot:
                     return default
                 dic = dic.get(search)
 
+                if isinstance(dic, str) and dic.isnumeric():
+                    continue
+
+                if dic and type(dic) is not int and len(dic) == 1 and not type(dic[list(dic)[0]]) == dict:
+                    possible = dic
+
             if not isinstance(dic, dict):
                 return dic
 
             del searching[-1]
 
+        return possible
+
     def locate(self, search_path, default=''):
         """Locate the object from the given search path
 
@@ -60,7 +69,7 @@ class Dot:
 
         return default
 
-    def dict_dot(self, search, dictionary, default):
+    def dict_dot(self, search, dictionary, default=''):
         """Takes a dot notation representation of a dictionary and fetches it from the dictionary.
 
         This will take something like s3.locations and look into the s3 dictionary and fetch the locations
diff --git a/masonite/managers/Manager.py b/masonite/managers/Manager.py
index ab6dd33..0288e16 100644
--- a/masonite/managers/Manager.py
+++ b/masonite/managers/Manager.py
@@ -6,6 +6,8 @@ from masonite.exceptions import (DriverNotFound,
                                  MissingContainerBindingNotFound,
                                  UnacceptableDriverType)
 
+from masonite.app import App
+
 
 class Manager:
     """Base Manager Class."""
@@ -13,7 +15,7 @@ class Manager:
     config = None
     driver_prefix = None
 
-    def __init__(self, container=None):
+    def __init__(self, container: App):
         """Manager constructor.
 
         Keyword Arguments:
@@ -45,7 +47,7 @@ class Manager:
             masonite.drivers.Driver -- Returns a driver which is an instance of the base Driver class.
         """
         self.create_driver(driver)
-        return self.container.resolve(self.manage_driver).load_manager(self)
+        return self.manage_driver.load_manager(self)
 
     def create_driver(self, driver=None):
         """Create the driver to be used.
@@ -74,7 +76,7 @@ class Manager:
                 )
                 return
             elif inspect.isclass(driver):
-                self.manage_driver = driver
+                self.manage_driver = self.container.resolve(driver)
                 return
 
             raise UnacceptableDriverType(
diff --git a/masonite/providers/QueueProvider.py b/masonite/providers/QueueProvider.py
index 690416f..b7120d5 100644
--- a/masonite/providers/QueueProvider.py
+++ b/masonite/providers/QueueProvider.py
@@ -18,5 +18,5 @@ class QueueProvider(ServiceProvider):
         self.app.bind('QueueConfig', queue)
 
     def boot(self, queue: QueueManager):
-        self.app.bind('Queue', queue(self.app).driver(self.app.make('QueueConfig').DRIVER))
-        self.app.swap(Queue, queue(self.app).driver(self.app.make('QueueConfig').DRIVER))
+        self.app.bind('Queue', queue.driver(self.app.make('QueueConfig').DRIVER))
+        self.app.swap(Queue, queue.driver(self.app.make('QueueConfig').DRIVER))


Test patch:
diff --git a/tests/broadcasts/test_sockets.py b/tests/broadcasts/test_sockets.py
index c102f77..96ed4f0 100644
--- a/tests/broadcasts/test_sockets.py
+++ b/tests/broadcasts/test_sockets.py
@@ -12,7 +12,7 @@ if os.getenv('ABLY_SECRET'):
         def setUp(self):
             self.app = TestSuite().create_container().container
             self.app.bind('BroadcastPusherDriver', BroadcastPusherDriver)
-            self.app.bind('BroadcastManager', BroadcastManager().load_container(self.app))
+            self.app.bind('BroadcastManager', BroadcastManager)
 
         def test_broadcast_loads_into_container(self):
             self.app.bind('Broadcast', self.app.make('BroadcastManager').driver('pusher'))
diff --git a/tests/core/test_app.py b/tests/core/test_app.py
index 086d8e0..d9e2e48 100644
--- a/tests/core/test_app.py
+++ b/tests/core/test_app.py
@@ -1,5 +1,4 @@
 import inspect
-import pytest
 
 from masonite.app import App
 from masonite.request import Request
@@ -11,6 +10,12 @@ import unittest
 REQUEST = Request({}).load_environ(generate_wsgi())
 
 
+class MockMail:
+
+    def __init__(self, request: Request):
+        self.request = request
+
+
 class TestApp(unittest.TestCase):
 
     def setUp(self):
@@ -25,6 +30,33 @@ class TestApp(unittest.TestCase):
         self.app.bind('Request', REQUEST)
         self.assertEqual(self.app.make('Request').cookies, [])
 
+    def test_app_makes_and_resolves(self):
+        self.app.bind('Request', REQUEST)
+        self.app.bind('MockMail', MockMail)
+        mockmail = self.app.make('MockMail')
+        self.assertIsInstance(mockmail.request, Request)
+
+    def test_app_makes_different_instances(self):
+        self.app.bind('MockMail', MockMail)
+        self.app.bind('Request', REQUEST)
+        m1 = self.app.make('MockMail')
+        m2 = self.app.make('MockMail')
+
+        self.assertNotEqual(id(m1), id(m2))
+    
+    def test_app_makes_singleton_instance(self):
+        self.app.bind('Request', REQUEST)
+        self.app.singleton('MockMail', MockMail)
+        m1 = self.app.make('MockMail')
+        m2 = self.app.make('MockMail')
+
+        self.assertEqual(id(m1), id(m2))
+        self.assertEqual(id(m1.request), id(m2.request))
+
+        m1.request.test = 'test'
+        self.assertEqual(m2.request.test, 'test')
+    
+
     def test_can_set_container_hook(self):
         self.app.on_bind('Request', self._func_on_bind)
         self.app.bind('Request', REQUEST)
diff --git a/tests/core/test_container.py b/tests/core/test_container.py
index 63e80b6..7e434b0 100644
--- a/tests/core/test_container.py
+++ b/tests/core/test_container.py
@@ -3,13 +3,20 @@ from masonite.request import Request
 from masonite.drivers import UploadDiskDriver
 from masonite.contracts import UploadContract
 from masonite.exceptions import ContainerError, StrictContainerException
-import pytest
+ 
 import unittest
 
 
 class MockObject:
     pass
 
+class MockSelfObject:
+
+    def __init__(self):
+        self.id = 1
+
+    def get_id(self):
+        return self.id
 
 class GetObject(MockObject):
 
@@ -38,18 +45,21 @@ class TestContainer(unittest.TestCase):
         self.app.bind('Request', Request(None))
         self.app.bind('MockObject', MockObject)
         self.app.bind('GetObject', GetObject)
+        self.app.bind('Container', self.app)
 
     def test_container_gets_direct_class(self):
         self.assertIsInstance(self.app.make('Request'), Request)
 
     def test_container_resolving_annotation(self):
-        self.assertIsInstance(self.app.resolve(self._function_test_annotation), MockObject.__class__)
+        self.assertIsInstance(self.app.resolve(self._function_test_annotation), MockObject)
 
     def _function_test_annotation(self, mock: MockObject):
         return mock
 
     def test_container_resolving_instance_of_object(self):
-        self.assertIsInstance(self.app.resolve(self._function_test_annotation), GetObject.__class__)
+        self.app = App()
+        self.app.bind('Get', GetObject)
+        self.assertIsInstance(self.app.resolve(self._function_test_annotation), GetObject)
 
     def test_container_resolving_similiar_objects(self):
         self.app.bind('GetAnotherObject', GetAnotherObject)
@@ -59,22 +69,22 @@ class TestContainer(unittest.TestCase):
         self.assertEqual(obj[1], 1)
 
     def _function_test_find_method_on_similiar_objects(self, user: GetAnotherObject, country: GetObject):
-        return [user().find(), country().find()]
+        return [user.find(), country.find()]
 
     def test_raises_error_when_getting_instances_of_classes(self):
         with self.assertRaises(ContainerError):
             self.assertTrue(self.app.resolve(self._function_test_find_method_on_similiar_objects))
 
     def _function_test_double_annotations(self, mock: MockObject, request: Request):
-        return {'mock': MockObject, 'request': Request}
+        return {'mock': mock, 'request': request}
 
     def test_container_resolving_multiple_annotations(self):
-        self.assertIsInstance(self.app.resolve(self._function_test_double_annotations)['mock'], MockObject.__class__)
-        self.assertIsInstance(self.app.resolve(self._function_test_double_annotations)['request'], Request.__class__)
+        self.assertIsInstance(self.app.resolve(self._function_test_double_annotations)['mock'], MockObject)
+        self.assertIsInstance(self.app.resolve(self._function_test_double_annotations)['request'], Request)
 
     def test_container_contract_returns_upload_disk_driver(self):
         self.app.bind('UploadDiskDriver', UploadDiskDriver)
-        self.assertIsInstance(self.app.resolve(self._function_test_contracts), UploadDiskDriver.__class__)
+        self.assertIsInstance(self.app.resolve(self._function_test_contracts), UploadDiskDriver)
 
     def _function_test_contracts(self, upload: UploadContract):
         return upload
@@ -109,21 +119,19 @@ class TestContainer(unittest.TestCase):
 
     def test_container_can_bind_and_make_from_class_key(self):
         self.app.bind(MakeObject, MakeObject)
-        self.assertEqual(self.app.make(MakeObject), MakeObject)
+        self.assertIsInstance(self.app.make(MakeObject), MakeObject)
 
     def test_container_makes_from_base_class(self):
         del self.app.providers['MockObject']
-        self.assertEqual(self.app.make(MockObject), GetObject)
+        self.assertIsInstance(self.app.make(MockObject), GetObject)
 
     def test_container_has_obj(self):
         assert self.app.has('Request')
         assert self.app.has(Request)
 
     def test_container_makes_from_contract(self):
-        self.app.providers = {}
-
         self.app.bind('UploadDriver', UploadDiskDriver)
-        self.assertEqual(self.app.make(UploadContract), UploadDiskDriver)
+        self.assertIsInstance(self.app.make(UploadContract), UploadDiskDriver)
 
     def test_strict_container_raises_exception(self):
         self.app = App(strict=True)
@@ -181,6 +189,12 @@ class TestContainer(unittest.TestCase):
 
         self.assertIsInstance(app.resolve(self._test_substitute), MakeObject)
 
+    def test_instantiates_obj(self):
+        app = App()
+        app.bind('MockSelf', MockSelfObject)
+
+        self.assertEqual(app.resolve(self._test_self_object).id, 1)
+
     def test_can_use_in_keyword(self):
         app = App()
         app.bind('test', 'value')
@@ -198,3 +212,6 @@ class TestContainer(unittest.TestCase):
 
     def _test_substitute(self, test: SubstituteThis):
         return test
+    
+    def _test_self_object(self, obj: MockSelfObject):
+        return obj
diff --git a/tests/core/test_controllers.py b/tests/core/test_controllers.py
index 72cccf8..9777d68 100644
--- a/tests/core/test_controllers.py
+++ b/tests/core/test_controllers.py
@@ -30,7 +30,7 @@ class TestController(unittest.TestCase):
 
         self.assertIsInstance(route.controller, ControllerTest.__class__)
         self.assertEqual(route.controller_method, 'show')
-        self.assertIsInstance(response, Request.__class__)
+        self.assertIsInstance(response, Request)
 
     def test_object_controller_constructor_resolves_container(self):
         self.app.bind('Request', Request)
@@ -46,4 +46,4 @@ class TestController(unittest.TestCase):
 
         self.assertIsInstance(route.controller, ControllerTest.__class__)
         self.assertEqual(route.controller_method, 'show')
-        self.assertIsInstance(response, Request.__class__)
+        self.assertIsInstance(response, Request)
diff --git a/tests/core/test_exception.py b/tests/core/test_exception.py
index 14f969d..c0285e1 100644
--- a/tests/core/test_exception.py
+++ b/tests/core/test_exception.py
@@ -1,4 +1,4 @@
-import pytest
+ 
 
 from masonite.app import App
 from masonite.exception_handler import ExceptionHandler
diff --git a/tests/core/test_mail_log_drivers.py b/tests/core/test_mail_log_drivers.py
index c121d17..22447bd 100644
--- a/tests/core/test_mail_log_drivers.py
+++ b/tests/core/test_mail_log_drivers.py
@@ -1,5 +1,5 @@
 from config import mail
-import pytest
+ 
 import os
 
 from masonite.app import App
diff --git a/tests/core/test_mailgun_driver.py b/tests/core/test_mailgun_driver.py
index 8d575b7..bae6e97 100644
--- a/tests/core/test_mailgun_driver.py
+++ b/tests/core/test_mailgun_driver.py
@@ -1,7 +1,7 @@
 
 import os
 
-import pytest
+ 
 
 from config import mail
 from masonite import env
diff --git a/tests/core/test_managers_mail_manager.py b/tests/core/test_managers_mail_manager.py
index cd3ee08..1df9d69 100644
--- a/tests/core/test_managers_mail_manager.py
+++ b/tests/core/test_managers_mail_manager.py
@@ -1,6 +1,6 @@
 import ssl
 
-import pytest
+ 
 
 from masonite.environment import LoadEnvironment
 
@@ -45,20 +45,20 @@ class TestMailManager(unittest.TestCase):
         self.app.bind('ViewClass', View(self.app))
 
     def test_mail_manager_loads_container(self):
-        mailManager = MailManager()
+        mailManager = MailManager(self.app)
         self.assertTrue(mailManager.load_container(self.app))
 
     def test_mail_manager_resolves_from_contract(self):
-        self.app.bind('MailManager', MailManager())
+        self.app.singleton('MailManager', MailManager)
         self.assertEqual(self.app.resolve(self._test_resolve), self.app.make('MailManager'))
 
     def _test_resolve(self, mail: MailManagerContract):
         return mail
 
     def test_creates_driver(self):
-        mailManager = MailManager()
+        mailManager = MailManager(self.app)
 
-        self.assertEqual(mailManager.load_container(self.app).manage_driver, object)
+        self.assertIsInstance(mailManager.manage_driver, object)
 
     def test_does_not_create_driver_with_initilization_container(self):
 
@@ -74,7 +74,7 @@ class TestMailManager(unittest.TestCase):
         MailManager(self.app).driver('mailtrap')
 
     def test_manager_sets_driver_throws_driver_not_found_exception(self):
-        with pytest.raises(DriverNotFound, message="Should raise DriverNotFound error"):
+        with self.assertRaises(DriverNotFound, message="Should raise DriverNotFound error"):
             MailManager(self.app).driver('mailtrap')
 
     def test_drivers_are_resolvable_by_container(self):
diff --git a/tests/core/test_requests.py b/tests/core/test_requests.py
index 2548b67..a746e58 100644
--- a/tests/core/test_requests.py
+++ b/tests/core/test_requests.py
@@ -2,24 +2,24 @@ import unittest
 from cgi import MiniFieldStorage
 from pydoc import locate
 
-import pytest
+ 
 
 from app.http.test_controllers.TestController import TestController
 from config import application, providers
 from masonite.app import App
 from masonite.exceptions import InvalidHTTPStatusCode, RouteException
-from masonite.helpers.routes import flatten_routes, get, group
+from masonite.helpers.routes import flatten_routes
 from masonite.helpers.time import cookie_expire_time
 from masonite.request import Request
 from masonite.response import Response
-from masonite.routes import Get, Route
+from masonite.routes import Get, Route, RouteGroup
 from masonite.testsuite.TestSuite import TestSuite, generate_wsgi
 
 WEB_ROUTES = flatten_routes([
-    get('/test', 'Controller@show').name('test'),
-    group('/a', [
-        get('/account', 'Controller@show').name('a_account'),
-    ])
+    Get('/test', 'Controller@show').name('test'),
+    RouteGroup([
+        Get('/account', 'Controller@show').name('a_account'),
+    ], prefix='/a')
 ])
 
 wsgi_request = generate_wsgi()
@@ -178,9 +178,9 @@ class TestRequest(unittest.TestCase):
 
         container.bind('Response', 'test')
         container.bind('WebRoutes', [
-            Get().route('url', None),
-            Get().route('url/', None),
-            Get().route('url/@firstname', None),
+            Get().route('url', 'TestController@show'),
+            Get().route('url/', 'TestController@show'),
+            Get().route('url/@firstname', 'TestController@show'),
         ])
 
         container.bind('Response', 'Route not found. Error 404')
@@ -256,8 +256,8 @@ class TestRequest(unittest.TestCase):
         app = App()
         app.bind('Request', self.request)
         app.bind('WebRoutes', [
-            get('/test/url', None).name('test.url'),
-            get('/test/url/@id', None).name('test.id')
+            Get('/test/url', 'TestController@show').name('test.url'),
+            Get('/test/url/@id', 'TestController@show').name('test.id')
         ])
         request = app.make('Request').load_app(app)
 
@@ -265,16 +265,16 @@ class TestRequest(unittest.TestCase):
         self.assertEqual(request.route('test.id', {'id': 1}), '/test/url/1')
         self.assertEqual(request.route('test.id', [1]), '/test/url/1')
 
-        with pytest.raises(RouteException):
+        with self.assertRaises(RouteException):
             self.assertTrue(request.route('not.exists', [1]))
 
     def test_request_redirection(self):
         app = App()
         app.bind('Request', self.request)
         app.bind('WebRoutes', [
-            get('/test/url', 'TestController@show').name('test.url'),
-            get('/test/url/@id', 'TestController@testing').name('test.id'),
-            get('/test/url/object', TestController.show).name('test.object')
+            Get('/test/url', 'TestController@show').name('test.url'),
+            Get('/test/url/@id', 'TestController@testing').name('test.id'),
+            Get('/test/url/object', TestController.show).name('test.object')
         ])
         request = app.make('Request').load_app(app)
 
@@ -294,8 +294,8 @@ class TestRequest(unittest.TestCase):
         app = App()
         app.bind('Request', self.request)
         app.bind('WebRoutes', [
-            get('/test/url', None).name('test.url'),
-            get('/test/url/@id', None).name('test.id')
+            Get('/test/url', 'TestController@show').name('test.url'),
+            Get('/test/url/@id', 'TestController@show').name('test.id')
         ])
         request = app.make('Request').load_app(app)
 
@@ -457,7 +457,7 @@ class TestRequest(unittest.TestCase):
     def test_request_sets_str_status_code(self):
         app = App()
         app.bind('Request', self.request)
-        app.bind('StatusCode', None)
+        app.bind('StatusCode', 'TestController@show')
         request = app.make('Request').load_app(app)
 
         request.status('200 OK')
@@ -496,7 +496,7 @@ class TestRequest(unittest.TestCase):
         self.assertEqual(request.is_status(500), True)
 
     def test_request_sets_invalid_int_status_code(self):
-        with pytest.raises(InvalidHTTPStatusCode):
+        with self.assertRaises(InvalidHTTPStatusCode):
             app = App()
             app.bind('Request', self.request)
             request = app.make('Request').load_app(app)
@@ -525,8 +525,8 @@ class TestRequest(unittest.TestCase):
         app = App()
         app.bind('Request', self.request)
         app.bind('WebRoutes', [
-            get('/test/url', None).name('test.url'),
-            get('/test/url/@id', None).name('test.id')
+            Get('/test/url', 'TestController@show').name('test.url'),
+            Get('/test/url/@id', 'TestController@show').name('test.id')
         ])
         request = app.make('Request').load_app(app)
 
@@ -540,8 +540,8 @@ class TestRequest(unittest.TestCase):
         app = App()
         app.bind('Request', self.request)
         app.bind('WebRoutes', [
-            get('/test/url', None).name('test.url'),
-            get('/test/url/@id', None).name('test.id')
+            Get('/test/url', 'TestController@show').name('test.url'),
+            Get('/test/url/@id', 'TestController@show').name('test.id')
         ])
         request = app.make('Request').load_app(app)
 
@@ -552,9 +552,9 @@ class TestRequest(unittest.TestCase):
         app = App()
         app.bind('Request', self.request)
         app.bind('WebRoutes', [
-            get('/test/url', 'TestController@show').name('test.url'),
-            get('/test/url/@id', 'ControllerTest@show').name('test.id'),
-            get('/test/url/controller/@id', TestController.show).name('test.controller'),
+            Get('/test/url', 'TestController@show').name('test.url'),
+            Get('/test/url/@id', 'ControllerTest@show').name('test.id'),
+            Get('/test/url/controller/@id', TestController.show).name('test.controller'),
         ])
 
         request = app.make('Request').load_app(app)
diff --git a/tests/core/test_service_provider.py b/tests/core/test_service_provider.py
index f7ada68..e5ec84b 100644
--- a/tests/core/test_service_provider.py
+++ b/tests/core/test_service_provider.py
@@ -13,7 +13,7 @@ class ContainerTest(ServiceProvider):
     def boot(self, request: Request, get: Get):
         return request
 
-    def testboot(self, request: Request, Get: Get):
+    def testboot(self, request: Request, get: Get):
         return request
 
 
@@ -66,6 +66,7 @@ class TestServiceProvider(unittest.TestCase):
 
     def setUp(self):
         self.app = TestSuite().create_container().container
+        self.app.resolve_parameters = True
         self.provider = ServiceProvider()
         self.provider.load_app(self.app).register()
         self.load_provider = LoadProvider()
@@ -88,12 +89,6 @@ class TestServiceProvider(unittest.TestCase):
 
         self.assertEqual(self.app.resolve(ContainerTest().testboot), self.app.make('Request'))
 
-    def test_can_call_container_with_annotation_with_self_parameter(self):
-        self.app.bind('Request', Request)
-        self.app.bind('Get', Get().route('url', None))
-
-        self.assertEqual(self.app.resolve(ContainerTest().testboot), self.app.make('Request'))
-
     def test_can_load_routes_into_container(self):
         self.assertTrue(len(self.app.make('WebRoutes')) > 2)
         self.assertEqual(self.app.make('WebRoutes')[-2:], [ROUTE1, ROUTE2])
diff --git a/tests/core/test_upload_manager.py b/tests/core/test_upload_manager.py
index 1c3f947..c1ba562 100644
--- a/tests/core/test_upload_manager.py
+++ b/tests/core/test_upload_manager.py
@@ -39,7 +39,7 @@ class TestUploadManager(unittest.TestCase):
         self.app.bind('UploadDiskDriver', UploadDiskDriver)
         self.app.bind('UploadS3Driver', UploadS3Driver)
         self.app.bind('Application', application)
-        self.app.bind('UploadManager', UploadManager().load_container(self.app))
+        self.app.bind('UploadManager', UploadManager)
 
     def test_upload_manager_grabs_drivers(self):
         self.assertIsInstance(self.app.make('UploadManager').driver('disk'), UploadDiskDriver)
@@ -52,6 +52,7 @@ class TestUploadManager(unittest.TestCase):
             self.app.make('UploadManager').driver(static)
 
     def test_disk_driver_creates_directory_if_not_exists(self):
+        print(self.app.make('UploadManager'))
         self.app.make('UploadManager').driver('disk').store(ImageMock(), location="storage/temp")
         self.assertTrue(os.path.exists('storage/temp'))
         shutil.rmtree('storage/temp')
@@ -68,7 +69,7 @@ class TestUploadManager(unittest.TestCase):
         with self.assertRaises(DriverNotFound):
             self.assertIsNone(self.app.bind(
                 'UploadManager',
-                UploadManager().load_container(self.app)
+                UploadManager(self.app).load_container(self.app)
             ))
 
     def test_upload_manager_switches_drivers(self):
diff --git a/tests/core/test_view.py b/tests/core/test_view.py
index a8010ec..a1fd028 100644
--- a/tests/core/test_view.py
+++ b/tests/core/test_view.py
@@ -1,7 +1,7 @@
 import glob
 import time
 
-import pytest
+ 
 from jinja2 import FileSystemLoader, PackageLoader
 
 from config import cache
@@ -150,7 +150,7 @@ class TestView(unittest.TestCase):
     def test_view_throws_exception_without_cache_binding(self):
         view = self.container.make('View')
 
-        with pytest.raises(RequiredContainerBindingNotFound):
+        with self.assertRaises(RequiredContainerBindingNotFound):
             view('test_cache').cache_for('5', 'seconds')
 
     def test_view_can_add_custom_filters(self):
@@ -206,7 +206,7 @@ class TestView(unittest.TestCase):
 
         view = self.container.make('View')
 
-        with pytest.raises(ValueError):
+        with self.assertRaises(ValueError):
             view(
                 'test_exception', {'test': 'test'}
             ).cache_for(1, 'monthss')
@@ -257,7 +257,7 @@ class TestView(unittest.TestCase):
 
     def test_throws_exception_on_incorrect_type(self):
         view = self.container.make('ViewClass')
-        with pytest.raises(ViewException):
+        with self.assertRaises(ViewException):
             assert view.render('test', {'', ''})
 
     def test_can_use_dot_templates(self):
diff --git a/tests/helpers/test_config.py b/tests/helpers/test_config.py
index b7dbfa6..02a4fc1 100644
--- a/tests/helpers/test_config.py
+++ b/tests/helpers/test_config.py
@@ -39,3 +39,18 @@ class TestConfig(unittest.TestCase):
 
     def test_dot_dict(self):
         self.assertEqual(Dot().dict_dot('async.driver', {'async': {'driver': 'me'}}, 'you'), 'me')
+
+    def test_dict_dot_works_for_deep_dictionaries(self):
+        dictionary = {
+            'storage': {
+                'drivers': {
+                    'disk': {
+                        'location': {
+                            'uploading': 'uploads/'
+                        }
+                    }
+                }
+            }
+        }
+
+        self.assertEqual(Dot().dict_dot('storage.drivers.disk.location', dictionary)['uploading'], 'uploads/')
diff --git a/tests/helpers/test_dot_notation.py b/tests/helpers/test_dot_notation.py
index 04fa942..a930966 100644
--- a/tests/helpers/test_dot_notation.py
+++ b/tests/helpers/test_dot_notation.py
@@ -1,4 +1,4 @@
-import pytest
+ 
 from masonite.helpers import dot, Dot as DictDot
 import unittest
 
@@ -13,7 +13,7 @@ class TestDot(unittest.TestCase):
         self.assertEqual(dot('hey.dot.another', compile_to="{1}/{.}"), "hey/dot/another")
         self.assertEqual(dot('hey.dot.another', compile_to="{1}/{.}"), "hey/dot/another")
         self.assertEqual(dot('hey.dot.another', compile_to="/{1}/{.}"), "/hey/dot/another")
-        with pytest.raises(ValueError):
+        with self.assertRaises(ValueError):
             self.assertEqual(dot('hey.dot.another', compile_to="{1}//{.}"), "hey/dot/another")
 
     def test_dict_dot(self):