Ejemplo n.º 1
0
class FindersTests(TestCase):
    def setUp(self):
        self.finders = Finders()
        self.first_finder = Mock()
        self.second_finder = Mock()

    def test_register(self):
        self.finders.register(self.first_finder)
        self.finders.register(self.second_finder)
        self.assertEqual(self.finders, [self.first_finder, self.second_finder])

    def test_register_twice(self):
        self.finders.register(self.first_finder)
        self.finders.register(self.first_finder)
        self.assertEqual(self.finders, [self.first_finder])

    def test_unregister(self):
        self.finders.register(self.first_finder)
        self.finders.unregister(self.first_finder)
        self.assertEqual(self.finders, [])
Ejemplo n.º 2
0
class FindersTests(TestCase):

    def setUp(self):
        self.finders = Finders()
        self.first_finder = Mock()
        self.second_finder = Mock()

    def test_register(self):
        self.finders.register(self.first_finder)
        self.finders.register(self.second_finder)
        self.assertEqual(self.finders, [self.first_finder, self.second_finder])

    def test_register_twice(self):
        self.finders.register(self.first_finder)
        self.finders.register(self.first_finder)
        self.assertEqual(self.finders, [self.first_finder])

    def test_unregister(self):
        self.finders.register(self.first_finder)
        self.finders.unregister(self.first_finder)
        self.assertEqual(self.finders, [])
Ejemplo n.º 3
0
 def setUp(self):
     self.finders = Finders()
     self.first_finder = Mock()
     self.second_finder = Mock()
Ejemplo n.º 4
0
 def setUp(self):
     self.finders = Finders()
     self.first_finder = Mock()
     self.second_finder = Mock()