Exemple #1
0
 def test_new_ong_dir(self, mock_mkdir, mock_path):
     mock_path.abspath.return_value = "ocr/setup.py"
     mock_path.dirname.return_value = "ocr"
     mock_path.join.return_value = "ocr/" + ONG_FOLDER
     new_ong_dir()
     mock_path.dirname.assert_called_with("ocr/setup.py")
     mock_path.join.assert_called_with("ocr", ONG_FOLDER)
     mock_mkdir.assert_called_with("ocr/" + ONG_FOLDER)
 def test_new_ong_dir(self, mock_mkdir, mock_path):
     mock_path.abspath.return_value = "ocr/setup.py"
     mock_path.dirname.return_value = "ocr"
     mock_path.join.return_value = "ocr/" + ONG_FOLDER
     new_ong_dir()
     mock_path.dirname.assert_called_with("ocr/setup.py")
     mock_path.join.assert_called_with("ocr", ONG_FOLDER)
     mock_mkdir.assert_called_with("ocr/" + ONG_FOLDER)
Exemple #3
0
from ocr.setup import is_installed, new_ong_dir, create_database, create_tables

if not is_installed():
    print "Installing..."
    new_ong_dir()
    create_database()
    create_tables()
else:
    print "Installed"