Ejemplo n.º 1
0
 def test_import_error(self, os, imp):
     imp.find_module.side_effect = ImportError()
     with pytest.raises(ConfigurationError):
         get_config_module()
Ejemplo n.º 2
0
 def test_missing_home(self, os, imp):
     os.path.exists.return_value = False
     imp.find_module.return_value = Mock(), Mock(), Mock()
     get_config_module()
     assert_called_once_with(os.mkdir, ANY)
Ejemplo n.º 3
0
    def test_get_config_module(self, os, imp):
        os.path.exists.return_value = True
        imp.find_module.return_value = Mock(), Mock(), Mock()
        imp.load_module.return_value = sentinel.config

        assert get_config_module() is sentinel.config
Ejemplo n.º 4
0
 def test_import_error(self, os, imp):
     imp.find_module.side_effect = ImportError()
     with pytest.raises(ConfigurationError):
         get_config_module()
Ejemplo n.º 5
0
 def test_missing_home(self, os, imp):
     os.path.exists.return_value = False
     imp.find_module.return_value = Mock(), Mock(), Mock()
     get_config_module()
     assert_called_once_with(os.mkdir, ANY)
Ejemplo n.º 6
0
    def test_get_config_module(self, os, imp):
        os.path.exists.return_value = True
        imp.find_module.return_value = Mock(), Mock(), Mock()
        imp.load_module.return_value = sentinel.config

        assert get_config_module() is sentinel.config