def test_download_jc_plugin(self): files = JtalksArtifacts().download_plugins( 'jcommune', '3.0.6.8629f39', ['questions-n-answers-plugin']) self.assertTrue(os.path.exists(files[0])) self.assertEqual(861914, os.stat(files[0]).st_size) for filename in files: os.remove(filename)
def _deploy(self, scriptsettings): shutil.rmtree('/home/jtalks/tomcat/webapps') os.mkdir('/home/jtalks/tomcat/webapps') DeployCommand( JtalksArtifacts(), Nexus(scriptsettings.build), Tomcat(path.expanduser('~/tomcat')), SanityTest(scriptsettings.get_tomcat_port(), scriptsettings.project), Backuper('/home/jtalks', DbOperations(scriptsettings.get_db_settings())), scriptsettings).deploy(scriptsettings.project, scriptsettings.build, scriptsettings.get_app_final_name(), scriptsettings.get_plugins())
def test_deploy_plugins_must_clean_previous_plugins(self): file('NexusTestDir/plugin.jar', 'w') JtalksArtifacts().deploy_plugins('NexusTestDir', []) self.assertFalse(os.path.exists('NexusTestDir/plugin.jar'))
def test_deploy_plugins_must_not_create_target_dir_its_name_was_not_passed( self): file('NexusTestDir/plugin.jar', 'w') JtalksArtifacts().deploy_plugins(None, ['NexusTestDir/plugin.jar']) self.assertFalse(os.path.exists('NexusTestDir/None/plugin.jar'))
def test_deploy_plugins_must_create_target_dir_if_it_not_exists(self): file('NexusTestDir/plugin.jar', 'w') JtalksArtifacts().deploy_plugins('NexusTestDir/notexisting', ['NexusTestDir/plugin.jar']) self.assertTrue(os.path.exists('NexusTestDir/notexisting/plugin.jar'))
def test_deploy_plugins(self): os.mkdir('NexusTestDir/plugins') file('NexusTestDir/plugin.jar', 'w') JtalksArtifacts().deploy_plugins('NexusTestDir/plugins', ['NexusTestDir/plugin.jar'])
def test_download_jcommune(self): gav, filename = JtalksArtifacts().download_war('jcommune', 2) self.assertTrue(os.path.exists(filename)) self.assertEqual(38996276, os.stat(filename).st_size) os.remove(filename)