"""
Tests for dependency.q.
"""

from __future__ import absolute_import

from unittest import TestCase

from dependency import Dependencies


class DependencyTests(TestCase):
    """
    Tests for Dependencies.
    """
    def test_registerAndGet(self):
        """
        It's possible to register and then retrieves services.
        """
        a, b = object(), object()
        deps = Dependencies()
        deps.registerService("A", a)
        deps.registerService("B", b)
        self.assertEqual(
            (a, b),
            (deps.getService("A"), deps.getService("B")))

@@ -576,8 +576,307 @@
 (%22B%22)))%0A
+%0A    def test_hasService(self):%0A        %22%22%22%0A        It's possible to check whether a service exists.%0A        %22%22%22%0A        deps = Dependencies()%0A        deps.registerService(%22A%22, object())%0A        self.assertEqual(%0A            (True, False),%0A            (deps.hasService(%22A%22), deps.hasService(%22B%22)))%0A%0A

Test I should've written earlier.