def test_setup_if_custom_webdir_does_not_exist_with_extensions(self): shutil.copytree('tests/data/app-4', self.build_dir) setup_webdir_if_it_doesnt_exist( utils.FormattedDict({ 'BUILD_DIR': self.build_dir, 'WEBDIR': 'public', 'LIBDIR': 'lib' })) self.assert_exists(self.build_dir, 'public') self.assert_exists(self.build_dir, 'public', 'index.php') self.assert_exists(self.build_dir, 'public', 'info.php') self.assert_exists(self.build_dir, 'public', 'technical-difficulties1.jpg') self.assert_exists(self.build_dir, '.bp-config') self.assert_exists(self.build_dir, '.bp-config', 'options.json') self.assert_exists(self.build_dir, '.bp-config', 'httpd', 'extra', 'httpd-remoteip.conf') self.assert_exists(self.build_dir, '.bp') self.assert_exists(self.build_dir, '.bp', 'logs') self.assert_exists(self.build_dir, '.bp', 'logs', 'some.log') self.assert_exists(self.build_dir, '.extensions') self.assert_exists(self.build_dir, '.extensions', 'some-ext') self.assert_exists(self.build_dir, '.extensions', 'some-ext', 'extension.py') eq_(4, len(os.listdir(self.build_dir))) eq_(3, len(os.listdir(os.path.join(self.build_dir, 'public'))))
def test_setup_if_custom_webdir_does_not_exist_with_extensions(self): shutil.copytree('tests/data/app-4', self.build_dir) setup_webdir_if_it_doesnt_exist(utils.FormattedDict({ 'BUILD_DIR': self.build_dir, 'WEBDIR': 'public', 'LIBDIR': 'lib' })) self.assert_exists(self.build_dir, 'public') self.assert_exists(self.build_dir, 'public', 'index.php') self.assert_exists(self.build_dir, 'public', 'info.php') self.assert_exists(self.build_dir, 'public', 'technical-difficulties1.jpg') self.assert_exists(self.build_dir, '.bp-config') self.assert_exists(self.build_dir, '.bp-config', 'options.json') self.assert_exists(self.build_dir, '.bp-config', 'httpd', 'extra', 'httpd-remoteip.conf') self.assert_exists(self.build_dir, '.bp') self.assert_exists(self.build_dir, '.bp', 'logs') self.assert_exists(self.build_dir, '.bp', 'logs', 'some.log') self.assert_exists(self.build_dir, '.extensions') self.assert_exists(self.build_dir, '.extensions', 'some-ext') self.assert_exists(self.build_dir, '.extensions', 'some-ext', 'extension.py') eq_(4, len(os.listdir(self.build_dir))) eq_(3, len(os.listdir(os.path.join(self.build_dir, 'public'))))
def test_setup_if_htdocs_with_stand_alone_app(self): shutil.copytree('tests/data/app-5', self.build_dir) setup_webdir_if_it_doesnt_exist(utils.FormattedDict({ 'BUILD_DIR': self.build_dir, 'WEB_SERVER': 'none' })) self.assert_exists(self.build_dir, 'app.php') eq_(1, len(os.listdir(self.build_dir)))
def test_system_files_not_moved_into_webdir(self): shutil.copytree('tests/data/app-with-all-possible-system-files-that-should-not-move', self.build_dir) setup_webdir_if_it_doesnt_exist(utils.FormattedDict({ 'BUILD_DIR': self.build_dir, 'WEBDIR': 'htdocs', 'LIBDIR': 'lib' })) self.assert_exists(self.build_dir, '.bp') self.assert_exists(self.build_dir, '.extensions') self.assert_exists(self.build_dir, '.bp-config') self.assert_exists(self.build_dir, 'manifest.yml') self.assert_exists(self.build_dir, '.profile.d') self.assert_exists(self.build_dir, '.profile')
def test_setup_if_custom_webdir_does_not_exist(self): shutil.copytree("tests/data/app-2", self.build_dir) setup_webdir_if_it_doesnt_exist( utils.FormattedDict({"BUILD_DIR": self.build_dir, "WEBDIR": "public", "LIBDIR": "lib"}) ) self.assert_exists(self.build_dir, "public") self.assert_exists(self.build_dir, "public", "index.php") self.assert_exists(self.build_dir, "public", "info.php") self.assert_exists(self.build_dir, "public", "technical-difficulties1.jpg") self.assert_exists(self.build_dir, ".bp-config") self.assert_exists(self.build_dir, ".bp-config", "options.json") self.assert_exists(self.build_dir, ".bp-config", "httpd", "extra", "httpd-remoteip.conf") eq_(2, len(os.listdir(self.build_dir))) eq_(3, len(os.listdir(os.path.join(self.build_dir, "public"))))
def test_setup_if_htdocs_does_not_exist(self): shutil.copytree('tests/data/app-2', self.build_dir) setup_webdir_if_it_doesnt_exist(utils.FormattedDict({ 'BUILD_DIR': self.build_dir, 'WEBDIR': 'htdocs', 'LIBDIR': 'lib' })) self.assert_exists(self.build_dir, 'htdocs') self.assert_exists(self.build_dir, 'htdocs', 'index.php') self.assert_exists(self.build_dir, 'htdocs', 'info.php') self.assert_exists(self.build_dir, 'htdocs', 'technical-difficulties1.jpg') self.assert_exists(self.build_dir, '.bp-config') self.assert_exists(self.build_dir, '.bp-config', 'options.json') self.assert_exists(self.build_dir, '.bp-config', 'httpd', 'extra', 'httpd-remoteip.conf') eq_(2, len(os.listdir(self.build_dir))) eq_(3, len(os.listdir(os.path.join(self.build_dir, 'htdocs'))))
def test_setup_if_htdocs_does_not_exist_with_extensions(self): shutil.copytree("tests/data/app-4", self.build_dir) setup_webdir_if_it_doesnt_exist( utils.FormattedDict({"BUILD_DIR": self.build_dir, "WEBDIR": "htdocs", "LIBDIR": "lib"}) ) self.assert_exists(self.build_dir, "htdocs") self.assert_exists(self.build_dir, "htdocs", "index.php") self.assert_exists(self.build_dir, "htdocs", "info.php") self.assert_exists(self.build_dir, "htdocs", "technical-difficulties1.jpg") self.assert_exists(self.build_dir, ".bp-config") self.assert_exists(self.build_dir, ".bp-config", "options.json") self.assert_exists(self.build_dir, ".bp-config", "httpd", "extra", "httpd-remoteip.conf") self.assert_exists(self.build_dir, ".bp") self.assert_exists(self.build_dir, ".bp", "logs") self.assert_exists(self.build_dir, ".bp", "logs", "some.log") self.assert_exists(self.build_dir, ".extensions") self.assert_exists(self.build_dir, ".extensions", "some-ext") self.assert_exists(self.build_dir, ".extensions", "some-ext", "extension.py") eq_(4, len(os.listdir(self.build_dir))) eq_(3, len(os.listdir(os.path.join(self.build_dir, "htdocs"))))
def test_setup_if_htdocs_with_stand_alone_app(self): shutil.copytree("tests/data/app-5", self.build_dir) setup_webdir_if_it_doesnt_exist(utils.FormattedDict({"BUILD_DIR": self.build_dir, "WEB_SERVER": "none"})) self.assert_exists(self.build_dir, "app.php") eq_(1, len(os.listdir(self.build_dir)))