@@ -0,0 +1,1418 @@
+from unittest import TestCase%0A%0Afrom nose.tools import raises, eq_%0Afrom mock import MagicMock, patch%0A%0Afrom pyolite.managers.manager import Manager%0A%0A%0Aclass TestManager(TestCase):%0A%0A  @raises(ValueError)%0A  def test_if_admin_repository_is_not_dir_it_should_raise_ValueError(self):%0A    mocked_path = MagicMock()%0A    mocked_git = MagicMock()%0A%0A    mocked_path.isdir.return_value = False%0A%0A    with patch.multiple('pyolite.managers.manager',%0A                        Path=MagicMock(return_value=mocked_path),%0A                        Git=MagicMock(return_value=mocked_git)):%0A      with patch.multiple('pyolite.managers.manager.Manager',%0A                          __abstractmethods__=set()):%0A%0A        Manager('/path/to/repo')%0A%0A  def test_get_or_create_method(self):%0A    mocked_path = MagicMock()%0A    mocked_git = MagicMock()%0A%0A    mocked_get = MagicMock(return_value='user')%0A    mocked_create = MagicMock()%0A%0A    Manager.get = mocked_get%0A    Manager.create = mocked_create%0A%0A    with patch.multiple('pyolite.managers.manager',%0A                        Path=MagicMock(return_value=mocked_path),%0A                        Git=MagicMock(return_value=mocked_git)):%0A      with patch.multiple('pyolite.managers.manager.Manager',%0A                          __abstractmethods__=set()):%0A%0A        manager = Manager('/path/to/admin/repo')%0A%0A        eq_(manager.get_or_create('mine', 'key'), 'user')%0A        mocked_get.assert_called_once_with('mine')%0A

Test simple managers behaviour