Commit db7c4550 authored by Spiros Koulouzis's avatar Spiros Koulouzis

switched to python 3.7 we had problems with 'deserialize_model'

parent d74c18e2
......@@ -23,6 +23,8 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -64,6 +66,19 @@ public class ToscaHelper {
init(sureToscaBasePath);
}
public static Boolean isServiceUp(String serviceBasePath) {
try {
URL serviceUrl = new URL(serviceBasePath);
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection();
//Set request to header to reduce load as Subirkumarsao said.
connection.setRequestMethod("HEAD");
int code = connection.getResponseCode();
} catch (IOException ex) {
return false;
}
return true;
}
/**
* @return the id
*/
......
......@@ -85,7 +85,7 @@ public class ToscaHelperTest {
provisionedToscaTemplate = objectMapper.readValue(ymlStr, ToscaTemplate.class);
String serviceBasePath = prop.getProperty("sure-tosca.base.path");
serviceUp = isServiceUp(serviceBasePath);
serviceUp = ToscaHelper.isServiceUp(serviceBasePath);
if (serviceUp) {
instance = new ToscaHelper(serviceBasePath);
instance.uploadToscaTemplate(toscaTemplatea2TVMopologies);
......@@ -154,18 +154,7 @@ public class ToscaHelperTest {
}
}
public static Boolean isServiceUp(String serviceBasePath) {
try {
URL serviceUrl = new URL(serviceBasePath);
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection();
//Set request to header to reduce load as Subirkumarsao said.
connection.setRequestMethod("HEAD");
int code = connection.getResponseCode();
} catch (IOException ex) {
return false;
}
return true;
}
/**
* Test of getTemplateVMsForVMTopology method, of class ToscaHelper.
......
......@@ -12,11 +12,9 @@
package nl.uva.sne.drip.sure_tosca.client;
import nl.uva.sne.drip.sure.tosca.client.ApiException;
import java.io.File;
import org.junit.Test;
import java.util.List;
import static nl.uva.sne.drip.commons.utils.ToscaHelperTest.isServiceUp;
import nl.uva.sne.drip.commons.utils.ToscaHelper;
import static org.junit.Assert.assertTrue;
import org.junit.Ignore;
......@@ -30,7 +28,7 @@ public class DefaultApiTest {
private final Boolean serviceUp;
public DefaultApiTest() {
serviceUp = isServiceUp(serviceBasePath);
serviceUp = ToscaHelper.isServiceUp(serviceBasePath);
}
// private final DefaultApi api = new DefaultApi();
......
......@@ -15,7 +15,7 @@ services:
rabbit:
image: rabbitmq:3.8-management
ports:
- "5671-5672:5671-5672"
- "5671-5672:5671-5672"
- "15672:15672"
- "4369:4369"
- "15671:15671"
......@@ -116,10 +116,10 @@ services:
ports:
- "30000:8080"
sure-tosca:
image: sure-tosca:3.0.0
ports:
- "8081:8081"
#sure-tosca:
#image: sure-tosca:3.0.0
#ports:
#- "8081:8081"
planner:
depends_on:
......
......@@ -131,8 +131,7 @@ public class DRIPService {
List<NodeTemplateMap> vmTopologies = helper.getVMTopologyTemplates();
for (NodeTemplateMap vmTopologyMap : vmTopologies) {
Map<String, Object> provisionerInterface = helper.getProvisionerInterfaceFromVMTopology(vmTopologyMap);
if (!provisionerInterface.containsKey(operation.toString().toLowerCase())) {
throw new RuntimeException("Fix this code. We are adding wrong interfaces");
// if (!provisionerInterface.containsKey(operation.toString().toLowerCase())) {
// Map<String, Object> inputsMap = new HashMap<>();
// inputsMap.put(operation.toString().toLowerCase(), caller);
// Map<String, Object> provisionMap = new HashMap<>();
......@@ -140,7 +139,7 @@ public class DRIPService {
// provisionerInterface.put(operation.toString().toLowerCase(), caller);
// vmTopologyMap = helper.setProvisionerInterfaceInVMTopology(vmTopologyMap, provisionerInterface);
// toscaTemplate = helper.setNodeInToscaTemplate(toscaTemplate, vmTopologyMap);
}
// }
}
return toscaTemplate;
}
......@@ -170,8 +169,12 @@ public class DRIPService {
void deleteActions(ToscaTemplate toscaTemplate) throws ApiException, TypeExeption, IOException {
helper.uploadToscaTemplate(toscaTemplate);
List<NodeTemplateMap> vmTopologies = helper.getVMTopologyTemplates();
for (NodeTemplateMap vmTopology : vmTopologies){
for (NodeTemplateMap vmTopology : vmTopologies) {
CloudsStormSubTopology.StatusEnum status = helper.getVMTopologyTemplateStatus(vmTopology);
if (!status.equals(CloudsStormSubTopology.StatusEnum.DELETED)) {
}
}
}
......
......@@ -16,7 +16,6 @@
package nl.uva.sne.drip.configuration;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
......@@ -26,7 +25,7 @@ import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
* @author S. Koulouzis
*/
@Configuration
@ComponentScan(basePackages = {"nl.uva.sne.drip", "nl.uva.sne.drip.api",
@ComponentScan(basePackages = {"nl.uva.sne.drip", "nl.uva.sne.drip.api",
"nl.uva.sne.drip.configuration", "nl.uva.sne.drip.dao", "nl.uva.sne.drip.model", "nl.uva.sne.drip.service"})
public class MongoConfig extends AbstractMongoConfiguration {
......
......@@ -28,20 +28,23 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import nl.uva.sne.drip.Swagger2SpringBoot;
import nl.uva.sne.drip.api.NotFoundException;
import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.commons.utils.ToscaHelper;
import nl.uva.sne.drip.configuration.MongoConfig;
import nl.uva.sne.drip.model.Exceptions.MissingCredentialsException;
import nl.uva.sne.drip.model.Exceptions.TypeExeption;
import nl.uva.sne.drip.model.tosca.Credential;
import nl.uva.sne.drip.sure.tosca.client.ApiException;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
......@@ -63,11 +66,22 @@ public class ServiceTests {
@Autowired
ToscaTemplateService toscaTemplateService;
@Autowired
DRIPService dripService;
@Value("${message.broker.queue.provisioner}")
private String provisionerQueueName;
@Value("${message.broker.host}")
private String messageBrokerHost;
@Value("${db.host}")
private static String dbHost;
private String toscaTemplateID;
private String testApplicationExampleToscaContents;
private static final String testApplicationExampleToscaFilePath = ".." + File.separator + "TOSCA" + File.separator + "application_example_updated.yaml";
private static final String testUpdatedApplicationExampleToscaFilePath = ".." + File.separator + "TOSCA" + File.separator + "application_example_updated.yaml";
private static final String testOutputApplicationExampleToscaFilePath = ".." + File.separator + "TOSCA" + File.separator + "application_example_updated.yaml";
private static final String testCredentialPath = ".." + File.separator + "fake_credentials" + File.separator + "test-geni.jks";
@Autowired
......@@ -87,6 +101,7 @@ public class ServiceTests {
@BeforeClass
public static void setUpClass() {
try {
_mongodExe = starter.prepare(new MongodConfigBuilder()
.version(Version.Main.PRODUCTION)
.net(new Net(MongoConfig.MONGO_TEST_HOST, MongoConfig.MONGO_TEST_PORT, Network.localhostIsIPv6()))
......@@ -124,268 +139,273 @@ public class ServiceTests {
Assert.assertTrue(true);
}
/**
* Test of saveFile method, of class ToscaTemplateService.
*
* @throws java.lang.Exception
*/
@Test
public void testToscaTemplateServiceSaveFile() throws Exception {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "saveFile");
FileInputStream in = new FileInputStream(testApplicationExampleToscaFilePath);
MultipartFile file = new MockMultipartFile("file", in);
toscaTemplateID = toscaTemplateService.saveFile(file);
Assert.assertNotNull(toscaTemplateID);
testApplicationExampleToscaContents = toscaTemplateService.findByID(toscaTemplateID);
Assert.assertNotNull(testApplicationExampleToscaContents);
}
/**
* Test of updateToscaTemplateByID method, of class ToscaTemplateService.
*/
@Test
public void testToscaTemplateServiceUpdateToscaTemplateByID_String_MultipartFile() {
FileInputStream in = null;
try {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "updateToscaTemplateByID");
if (toscaTemplateID == null) {
testToscaTemplateServiceSaveFile();
}
in = new FileInputStream(testUpdatedApplicationExampleToscaFilePath);
MultipartFile file = new MockMultipartFile("file", in);
String expResult = toscaTemplateID;
String result = toscaTemplateService.updateToscaTemplateByID(toscaTemplateID, file);
assertEquals(expResult, result);
String updatedTemplate = toscaTemplateService.findByID(result);
Assert.assertNotNull(updatedTemplate);
Assert.assertNotEquals(result, testApplicationExampleToscaContents);
} catch (FileNotFoundException ex) {
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException ex) {
fail(ex.getMessage());
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
/**
* Test of updateToscaTemplateByID method, of class ToscaTemplateService.
*
* @throws java.io.FileNotFoundException
*/
@Test
public void testToscaTemplateServiceUpdateToscaTemplateByID_Exception_MultipartFile() throws FileNotFoundException, IOException {
FileInputStream in = new FileInputStream(testUpdatedApplicationExampleToscaFilePath);
MultipartFile file = new MockMultipartFile("file", in);
try {
toscaTemplateService.updateToscaTemplateByID("0", file);
} catch (Exception ex) {
if (!(ex instanceof NoSuchElementException)) {
fail(ex.getMessage());
}
}
}
/**
* Test of findByID method, of class ToscaTemplateService.
*/
@Test
public void testToscaTemplateServiceFindByID() {
try {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "findByID");
if (toscaTemplateID == null) {
testToscaTemplateServiceSaveFile();
}
String result = toscaTemplateService.findByID(toscaTemplateID);
Assert.assertNotNull(result);
assertEquals(testApplicationExampleToscaContents, result);
} catch (JsonProcessingException ex) {
fail(ex.getMessage());
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
fail(ex.getMessage());
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
}
}
// /**
// * Test of saveFile method, of class ToscaTemplateService.
// *
// * @throws java.lang.Exception
// */
// @Test
// public void testToscaTemplateServiceSaveFile() throws Exception {
// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "saveFile");
// FileInputStream in = new FileInputStream(testApplicationExampleToscaFilePath);
// MultipartFile file = new MockMultipartFile("file", in);
// toscaTemplateID = toscaTemplateService.saveFile(file);
// Assert.assertNotNull(toscaTemplateID);
// testApplicationExampleToscaContents = toscaTemplateService.findByID(toscaTemplateID);
// Assert.assertNotNull(testApplicationExampleToscaContents);
// }
//
// /**
// * Test of updateToscaTemplateByID method, of class ToscaTemplateService.
// */
// @Test
// public void testToscaTemplateServiceUpdateToscaTemplateByID_String_MultipartFile() {
// FileInputStream in = null;
// try {
// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "updateToscaTemplateByID");
// if (toscaTemplateID == null) {
// testToscaTemplateServiceSaveFile();
// }
// in = new FileInputStream(testUpdatedApplicationExampleToscaFilePath);
// MultipartFile file = new MockMultipartFile("file", in);
// String expResult = toscaTemplateID;
// String result = toscaTemplateService.updateToscaTemplateByID(toscaTemplateID, file);
// assertEquals(expResult, result);
// String updatedTemplate = toscaTemplateService.findByID(result);
// Assert.assertNotNull(updatedTemplate);
// Assert.assertNotEquals(result, testApplicationExampleToscaContents);
// } catch (FileNotFoundException ex) {
// Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
// } catch (Exception ex) {
// Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
// } finally {
// try {
// if (in != null) {
// in.close();
// }
// } catch (IOException ex) {
// fail(ex.getMessage());
// Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
// }
// }
// }
//
// /**
// * Test of updateToscaTemplateByID method, of class ToscaTemplateService.
// *
// * @throws java.io.FileNotFoundException
// */
// @Test
// public void testToscaTemplateServiceUpdateToscaTemplateByID_Exception_MultipartFile() throws FileNotFoundException, IOException {
// FileInputStream in = new FileInputStream(testUpdatedApplicationExampleToscaFilePath);
// MultipartFile file = new MockMultipartFile("file", in);
// try {
// toscaTemplateService.updateToscaTemplateByID("0", file);
// } catch (Exception ex) {
// if (!(ex instanceof NoSuchElementException)) {
// fail(ex.getMessage());
// }
// }
// }
//
// /**
// * Test of findByID method, of class ToscaTemplateService.
// */
// @Test
// public void testToscaTemplateServiceFindByID() {
// try {
// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "findByID");
// if (toscaTemplateID == null) {
// testToscaTemplateServiceSaveFile();
// }
// String result = toscaTemplateService.findByID(toscaTemplateID);
// Assert.assertNotNull(result);
// assertEquals(testApplicationExampleToscaContents, result);
// } catch (JsonProcessingException ex) {
// fail(ex.getMessage());
// Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
// } catch (Exception ex) {
// fail(ex.getMessage());
// Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
// }
// }
/**
* Test of deleteByID method, of class ToscaTemplateService.
*/
@Test
public void testToscaTemplateServiceDeleteByID() {
if (isServiceUp(sureToscaBasePath)) {
if (ToscaHelper.isServiceUp(sureToscaBasePath)) {
try {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "deleteByID");
if (toscaTemplateID == null) {
testToscaTemplateServiceSaveFile();
}
toscaTemplateService.deleteByID(toscaTemplateID);
String id = toscaTemplateService.findByID(toscaTemplateID);
FileInputStream in = new FileInputStream(testApplicationExampleToscaFilePath);
MultipartFile file = new MockMultipartFile("file", in);
String id = toscaTemplateService.saveFile(file);
Assert.assertNotNull(id);
toscaTemplateService.deleteByID(id);
id = toscaTemplateService.findByID(id);
} catch (Exception ex) {
if (!(ex instanceof NoSuchElementException)) {
fail(ex.getMessage());
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
}
} finally {
try {
testToscaTemplateServiceSaveFile();
} catch (Exception ex) {
fail(ex.getMessage());
Logger.getLogger(ServiceTests.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
public static Boolean isServiceUp(String serviceBasePath) {
try {
URL serviceUrl = new URL(serviceBasePath);
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection();
//Set request to header to reduce load as Subirkumarsao said.
connection.setRequestMethod("HEAD");
int code = connection.getResponseCode();
} catch (IOException ex) {
return false;
}
return true;
}
/**
* Test of getAllIds method, of class ToscaTemplateService.
*
* @throws java.lang.Exception
*/
@Test
public void testToscaTemplateServiceGetAllIds() throws Exception {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "getAllIds");
testToscaTemplateServiceDeleteAll();
int numOfINst = 3;
for (int i = 1; i <= numOfINst; i++) {
testToscaTemplateServiceSaveFile();
}
List<String> result = toscaTemplateService.getAllIds();
assertEquals(numOfINst, result.size());
}
@Test
public void testToscaTemplateServiceDeleteAll() {
toscaTemplateService.deleteAll();
int size = toscaTemplateService.getAllIds().size();
assertEquals(0, size);
}
/**
* Test of save method, of class CredentialService.
*/
@Test
public void testCredentialServiceSave() {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "save");
saveCredential();
}
@Test
public void testCredentialService() throws IOException, NoSuchAlgorithmException {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "testCredentialService");
String keyStoreEncoded = Converter.encodeFileToBase64Binary(testCredentialPath);
Credential credential = new Credential();
credential.setCloudProviderName("ExoGENI");
Map<String, String> keys = new HashMap<>();
keys.put("keystore", keyStoreEncoded);
credential.setKeys(keys);
credential.setToken("1234");
credential.setTokenType("password");
credential.setUser("user");
String keyStoreEncodedFromCredential = credential.getKeys().get("keystore");
assertEquals(keyStoreEncoded, keyStoreEncodedFromCredential);
String copyTestCredentialPath = ".." + File.separator + "fake_credentials" + File.separator + "copy_of_test-geni.jks";
Converter.decodeBase64BToFile(keyStoreEncodedFromCredential, copyTestCredentialPath);
String keystorFileChecksum = Converter.getFileMD5(testCredentialPath);
String keystorFileCopyChecksum = Converter.getFileMD5(copyTestCredentialPath);
assertEquals(keystorFileChecksum, keystorFileCopyChecksum);
}
public String saveCredential() {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "saveCredential");
Credential document = new Credential();
document.setCloudProviderName("exogeni");
Map<String, String> keys = new HashMap<>();
keys.put("keystore", "/qTlqams0Ppq2rnaOgL5am7ExGO2nMsOZYM61kiAnsvkOixUuoPy9r4d4OfhwQXXg3lZmeRITjNz4ps+hIDKuxodIQXgBtfMy9Kx8Syb9bIl/MQQls5hWyp9yHAl6vAampoxYu0170lceT1sds4OCz3tM9eF7/UoBQwXBPo94QhO1/vSbtICyVsm3Z2HeGKcBWobT3opZV2w30GqX/7OBmNeIG7RBMPuxLsUxJ9Alahi1zXOUjLkd2bmmVFREngmeubgCzPFxxCQQrZK6WratTzJKc1sRVNK5GJzTwi9BlcZSQSgprum9yVHUgQc6Ylmvdrkhn2g9SlluY2JAZyCZvHYaRBKE4o5bXBDumTy1YAPMNPTfpeeLz+YmH0GMfVwKkxtIBpjb045QseoIWcqxke60WWfJguaTqymXknmcqcLNz+UzUdfVfyurOy9X8xmTGCW5V4N");
document.setKeys(keys);
document.setToken("secret");
document.setTokenType("password");
return credentialService.save(document);
}
/**
* Test of findByID method, of class CredentialService.
*
* @throws java.lang.Exception
*/
@Test
public void testCredentialServiceFindByID() throws Exception {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "findByID");
String id = saveCredential();
Credential result = credentialService.findByID(id);
assertNotNull(result);
}
/**
* Test of deleteByID method, of class CredentialService.
*
* @throws com.fasterxml.jackson.core.JsonProcessingException
*/
@Test
public void testCredentialServiceDeleteByID() throws JsonProcessingException {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "deleteByID");
String id = saveCredential();
credentialService.deleteByID(id);
try {
Credential res = credentialService.findByID(id);
assertNotNull(res);
} catch (Exception ex) {
if (!(ex instanceof NoSuchElementException)) {
fail(ex.getMessage());
}
}
}
/**
* Test of getAllIds method, of class CredentialService.
*/
@Test
public void testCredentialServiceGetAllIds() {
Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "getAllIds");
testCredentialServiceDeleteAll();
int numOfINst = 3;
for (int i = 1; i <= numOfINst; i++) {
saveCredential();
}
List<String> result = credentialService.getAllIds();
assertEquals(numOfINst, result.size());
}
/**
* Test of deleteAll method, of class CredentialService.
*/
@Test
public void testCredentialServiceDeleteAll() {
credentialService.deleteAll();
int size = credentialService.getAllIds().size();
assertEquals(0, size);
}
//// /**
//// * Test of getAllIds method, of class ToscaTemplateService.
//// *
//// * @throws java.lang.Exception
//// */
//// @Test
//// public void testToscaTemplateServiceGetAllIds() throws Exception {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "getAllIds");
//// testToscaTemplateServiceDeleteAll();
//// int numOfINst = 3;
//// for (int i = 1; i <= numOfINst; i++) {
//// testToscaTemplateServiceSaveFile();
//// }
//// List<String> result = toscaTemplateService.getAllIds();
//// assertEquals(numOfINst, result.size());
//// }
////
//// @Test
//// public void testToscaTemplateServiceDeleteAll() {
//// toscaTemplateService.deleteAll();
//// int size = toscaTemplateService.getAllIds().size();
//// assertEquals(0, size);
//// }
////
//// /**
//// * Test of save method, of class CredentialService.
//// */
//// @Test
//// public void testCredentialServiceSave() {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "save");
//// saveCredential();
//// }
////
//// @Test
//// public void testCredentialService() throws IOException, NoSuchAlgorithmException {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "testCredentialService");
//// String keyStoreEncoded = Converter.encodeFileToBase64Binary(testCredentialPath);
////
//// Credential credential = new Credential();
//// credential.setCloudProviderName("ExoGENI");
//// Map<String, String> keys = new HashMap<>();
//// keys.put("keystore", keyStoreEncoded);
//// credential.setKeys(keys);
//// credential.setToken("1234");
//// credential.setTokenType("password");
//// credential.setUser("user");
////
//// String keyStoreEncodedFromCredential = credential.getKeys().get("keystore");
//// assertEquals(keyStoreEncoded, keyStoreEncodedFromCredential);
////
//// String copyTestCredentialPath = ".." + File.separator + "fake_credentials" + File.separator + "copy_of_test-geni.jks";
//// Converter.decodeBase64BToFile(keyStoreEncodedFromCredential, copyTestCredentialPath);
////
//// String keystorFileChecksum = Converter.getFileMD5(testCredentialPath);
//// String keystorFileCopyChecksum = Converter.getFileMD5(copyTestCredentialPath);
////
//// assertEquals(keystorFileChecksum, keystorFileCopyChecksum);
//// }
////
//// public String saveCredential() {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "saveCredential");
//// Credential document = new Credential();
//// document.setCloudProviderName("exogeni");
//// Map<String, String> keys = new HashMap<>();
//// keys.put("keystore", "/qTlqams0Ppq2rnaOgL5am7ExGO2nMsOZYM61kiAnsvkOixUuoPy9r4d4OfhwQXXg3lZmeRITjNz4ps+hIDKuxodIQXgBtfMy9Kx8Syb9bIl/MQQls5hWyp9yHAl6vAampoxYu0170lceT1sds4OCz3tM9eF7/UoBQwXBPo94QhO1/vSbtICyVsm3Z2HeGKcBWobT3opZV2w30GqX/7OBmNeIG7RBMPuxLsUxJ9Alahi1zXOUjLkd2bmmVFREngmeubgCzPFxxCQQrZK6WratTzJKc1sRVNK5GJzTwi9BlcZSQSgprum9yVHUgQc6Ylmvdrkhn2g9SlluY2JAZyCZvHYaRBKE4o5bXBDumTy1YAPMNPTfpeeLz+YmH0GMfVwKkxtIBpjb045QseoIWcqxke60WWfJguaTqymXknmcqcLNz+UzUdfVfyurOy9X8xmTGCW5V4N");
//// document.setKeys(keys);
//// document.setToken("secret");
//// document.setTokenType("password");
////
//// return credentialService.save(document);
//// }
////
//// /**
//// * Test of findByID method, of class CredentialService.
//// *
//// * @throws java.lang.Exception
//// */
//// @Test
//// public void testCredentialServiceFindByID() throws Exception {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "findByID");
//// String id = saveCredential();
//// Credential result = credentialService.findByID(id);
//// assertNotNull(result);
//// }
////
//// /**
//// * Test of deleteByID method, of class CredentialService.
//// *
//// * @throws com.fasterxml.jackson.core.JsonProcessingException
//// */
//// @Test
//// public void testCredentialServiceDeleteByID() throws JsonProcessingException {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "deleteByID");
//// String id = saveCredential();
//// credentialService.deleteByID(id);
//// try {
//// Credential res = credentialService.findByID(id);
//// assertNotNull(res);
//// } catch (Exception ex) {
//// if (!(ex instanceof NoSuchElementException)) {
//// fail(ex.getMessage());
//// }
//// }
//// }
////
//// /**
//// * Test of getAllIds method, of class CredentialService.
//// */
//// @Test
//// public void testCredentialServiceGetAllIds() {
//// Logger.getLogger(ServiceTests.class.getName()).log(Level.INFO, "getAllIds");
//// testCredentialServiceDeleteAll();
//// int numOfINst = 3;
//// for (int i = 1; i <= numOfINst; i++) {
//// saveCredential();
//// }
//// List<String> result = credentialService.getAllIds();
//// assertEquals(numOfINst, result.size());
//// }
////
//// /**
//// * Test of deleteAll method, of class CredentialService.
//// */
//// @Test
//// public void testCredentialServiceDeleteAll() {
//// credentialService.deleteAll();
//// int size = credentialService.getAllIds().size();
//// assertEquals(0, size);
//// }
////
//// @Test
//// public void testProvision() throws FileNotFoundException, IOException, MissingCredentialsException, ApiException, TypeExeption, JsonProcessingException, TimeoutException, InterruptedException, NotFoundException {
//// if (ToscaHelper.isServiceUp(sureToscaBasePath) && ToscaHelper.isServiceUp("http://" + messageBrokerHost + ":15672")) {
//// Credential document = new Credential();
//// document.setCloudProviderName("exogeni");
//// Map<String, String> keys = new HashMap<>();
//// keys.put("keystore", "/qTlqams0Ppq2rnaOgL5am7ExGO2nMsOZYM61kiAnsvkOixUuoPy9r4d4OfhwQXXg3lZmeRITjNz4ps+hIDKuxodIQXgBtfMy9Kx8Syb9bIl/MQQls5hWyp9yHAl6vAampoxYu0170lceT1sds4OCz3tM9eF7/UoBQwXBPo94QhO1/vSbtICyVsm3Z2HeGKcBWobT3opZV2w30GqX/7OBmNeIG7RBMPuxLsUxJ9Alahi1zXOUjLkd2bmmVFREngmeubgCzPFxxCQQrZK6WratTzJKc1sRVNK5GJzTwi9BlcZSQSgprum9yVHUgQc6Ylmvdrkhn2g9SlluY2JAZyCZvHYaRBKE4o5bXBDumTy1YAPMNPTfpeeLz+YmH0GMfVwKkxtIBpjb045QseoIWcqxke60WWfJguaTqymXknmcqcLNz+UzUdfVfyurOy9X8xmTGCW5V4N");
//// document.setKeys(keys);
//// document.setToken("secret");
//// document.setTokenType("password");
////
//// String credentialID = credentialService.save(document);
//// assertNotNull(credentialID);
////
//// FileInputStream in = new FileInputStream(testApplicationExampleToscaFilePath);
////
//// MultipartFile file = new MockMultipartFile("file", in);
//// toscaTemplateID = toscaTemplateService.saveFile(file);
////
//// dripService.setRequestQeueName(provisionerQueueName);
//// String planedYemplateId = dripService.provision(toscaTemplateID);
//// }
// }
}
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (sure_tosca-flask-server)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (sure_tosca-flask-server) (2)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
......
......@@ -3,8 +3,9 @@
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
<excludeFolder url="file://$MODULE_DIR$/venv3-7" />
</content>
<orderEntry type="jdk" jdkName="Python 3.8 (sure_tosca-flask-server)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.7 (sure_tosca-flask-server) (2)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
FROM python:3.8-buster
FROM python:3.7-buster
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
......
......@@ -14,6 +14,7 @@ from tinydb.middlewares import CachingMiddleware
from tinydb.storages import MemoryStorage
from toscaparser.functions import GetAttribute
from toscaparser.tosca_template import ToscaTemplate
from werkzeug.datastructures import FileStorage
from sure_tosca.models.base_model_ import Model
from sure_tosca.models.node_template import NodeTemplateModel as NodeTemplateModel
......@@ -45,7 +46,6 @@ root_key = 'root_key'
def query_db(queries, db=None):
results = db.all()
if queries:
query = reduce(lambda a, b: a & b, queries)
results = db.search(query)
......@@ -102,11 +102,10 @@ def purge_all_tables():
interface_types_db.close()
def save(file):
def save(file: FileStorage):
# try:
# tosca_template_file_path = os.path.join(db_dir_path, file.filename)
start = time.time()
logger.info("Got request for tosca template")
purge_all_tables()
dictionary = yaml.safe_load(file.stream)
......
......@@ -20,7 +20,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_properties'.format(
......@@ -35,7 +35,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_types'.format(
id=id_example, node_name='compute'),
......@@ -49,7 +49,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_requirements'.format(
......@@ -65,7 +65,7 @@ class TestDefaultController(BaseTestCase):
"""
# query_string = [('anchors', 'anchors_example'), ('derived_from', 'derived_from_example')]
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/dsl_definitions'.format(id=id_example),
method='GET')
......@@ -76,7 +76,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/imports'.format(id=id_example),
method='GET')
......@@ -87,7 +87,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/outputs'.format(
id=id_example, node_name='compute'),
......@@ -101,7 +101,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/properties'.format(
id=id_example, node_name='compute'),
......@@ -115,7 +115,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/requirements'.format(
id=id_example, node_name='kubernetes'),
......@@ -129,7 +129,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
query_string = [('type_name', None),
('node_name', 'compute'),
('has_interfaces', True),
......@@ -183,7 +183,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/type_name'.format(
id=id_example, node_name='compute'),
......@@ -197,7 +197,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/derived_from'.format(
id=id_example, node_name='kubernetes'),
......@@ -211,7 +211,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/related'.format(
id=id_example, node_name='mysql'),
......@@ -225,7 +225,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
query_string = [('type_name', None),
('derived_from', None)]
response = self.client.open(
......@@ -239,7 +239,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template'.format(id=id_example),
method='GET')
......@@ -252,7 +252,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}'.format(id=id_example),
method='GET')
......@@ -265,7 +265,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
query_string = [('kind_of_type', 'interface_types'),
('has_interfaces', None),
('type_name', 'tosca.interfaces.ARTICONF.CloudsStorm'),
......@@ -304,7 +304,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
properties = {'properties': {'cpu_frequency': '2 GHz'}}
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/properties'.format(
......@@ -316,60 +316,14 @@ class TestDefaultController(BaseTestCase):
self.assertEqual(response.status_code, 200)
self.assertIsInstance(response.json, list)
def upload_2_topologies_file(self):
tosca_path = "../../../TOSCA/"
file_name = 'application_example_2_topologies.yaml' # 'application_example_updated.yaml' # 'application_example_2_topologies.yaml'
input_tosca_file_path = tosca_path + '/' + file_name
if not os.path.exists(input_tosca_file_path):
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/' + file_name
dir_path = os.path.dirname(os.path.realpath(__file__))
self.assertEqual(True, os.path.exists(input_tosca_file_path),
'Starting from: ' + dir_path + ' Input TOSCA file: ' + input_tosca_file_path + ' not found')
with open(input_tosca_file_path, 'r') as file:
contents = file.read()
byte_contents = bytes(contents, 'utf8')
data = dict(file=(BytesIO(byte_contents), input_tosca_file_path))
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template',
method='POST',
data=data,
content_type='multipart/form-data')
file_id = response.data.decode('utf-8').replace('\n', '')
return file_id
def upload_application_example_file(self):
tosca_path = "../../../TOSCA/"
file_name = 'application_example_updated.yaml' # 'application_example_updated.yaml' # 'application_example_2_topologies.yaml'
input_tosca_file_path = tosca_path + '/' + file_name
if not os.path.exists(input_tosca_file_path):
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/' + file_name
dir_path = os.path.dirname(os.path.realpath(__file__))
self.assertEqual(True, os.path.exists(input_tosca_file_path),
'Starting from: ' + dir_path + ' Input TOSCA file: ' + input_tosca_file_path + ' not found')
with open(input_tosca_file_path, 'r') as file:
contents = file.read()
byte_contents = bytes(contents, 'utf8')
data = dict(file=(BytesIO(byte_contents), input_tosca_file_path))
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template',
method='POST',
data=data,
content_type='multipart/form-data')
file_id = response.data.decode('utf-8').replace('\n', '')
return file_id
def test_get_node_templates2(self):
"""Test case for get_node_templates
"""
id_example = self.upload_application_example_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates'.format(id=id_example),
......@@ -385,7 +339,7 @@ class TestDefaultController(BaseTestCase):
"""
id_example = self.upload_2_topologies_file()
id_example = self.upload_file('application_example_2_topologies.yaml')
query_string = [('instance_name', 'instance_name_example'),
('operation_name', 'provision')]
response = self.client.open(
......@@ -397,8 +351,30 @@ class TestDefaultController(BaseTestCase):
self.assertEqual(response.status_code, 200)
self.assertIsInstance(response.json, dict)
def upload_file(self, file_name):
tosca_path = "../../../TOSCA/"
input_tosca_file_path = tosca_path + '/' + file_name
if not os.path.exists(input_tosca_file_path):
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/' + file_name
dir_path = os.path.dirname(os.path.realpath(__file__))
self.assertEqual(True, os.path.exists(input_tosca_file_path),
'Starting from: ' + dir_path + ' Input TOSCA file: ' + input_tosca_file_path + ' not found')
with open(input_tosca_file_path, 'r') as file:
contents = file.read()
byte_contents = bytes(contents, 'utf8')
data = dict(file=(BytesIO(byte_contents), input_tosca_file_path))
response = self.client.open(
'/tosca-sure/1.0.0/tosca_template',
method='POST',
data=data,
content_type='multipart/form-data')
return response.data.decode('utf-8').replace('\n', '')
if __name__ == '__main__':
import unittest
unittest.main()
\ No newline at end of file
unittest.main()
import os
from unittest import TestCase
from six import BytesIO
from werkzeug.datastructures import FileStorage
from sure_tosca.models import ToscaTemplateModel
from sure_tosca.service import tosca_template_service
class Test(TestCase):
def test_get_tosca_template_model_by_id(self):
doc_id = tosca_template_service.save(self.upload_file('application_example_updated.yaml'))
tosca_template_dict = tosca_template_service.get_tosca_template_dict_by_id(doc_id)
tosca_template_model = ToscaTemplateModel.from_dict(tosca_template_dict)
self.assertIsNotNone(tosca_template_model)
self.assertIsNotNone(tosca_template_model.topology_template)
self.assertIsNotNone(tosca_template_model.topology_template.node_templates)
def upload_file(self, file_name):
tosca_path = "../../../TOSCA/"
input_tosca_file_path = tosca_path + '/' + file_name
if not os.path.exists(input_tosca_file_path):
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/' + file_name
dir_path = os.path.dirname(os.path.realpath(__file__))
self.assertEqual(True, os.path.exists(input_tosca_file_path),
'Starting from: ' + dir_path + ' Input TOSCA file: ' + input_tosca_file_path + ' not found')
file = open(input_tosca_file_path, "r")
# with open(input_tosca_file_path, 'r') as file:
# contents = file.read()
# byte_contents = bytes(contents, 'utf8')
with open(input_tosca_file_path, 'r') as file:
contents = file.read()
byte_contents = bytes(contents, 'utf8')
# data = dict(file=(BytesIO(byte_contents), input_tosca_file_path))
return FileStorage(stream=BytesIO(byte_contents), filename=input_tosca_file_path, name=input_tosca_file_path,
content_type=None,
content_length=None, headers=None)
......@@ -90,6 +90,29 @@ def deserialize_datetime(string):
return string
# def deserialize_model(data, klass):
# """Deserializes list or dict to model.
#
# :param data: dict, list.
# :type data: dict | list
# :param klass: class literal.
# :return: model object.
# """
# instance = klass()
#
# if not instance.swagger_types:
# return data
#
# for attr, attr_type in six.iteritems(instance.swagger_types):
# if data is not None \
# and instance.attribute_map[attr] in data \
# and isinstance(data, (list, dict)):
# value = data[instance.attribute_map[attr]]
# setattr(instance, attr, _deserialize(value, attr_type))
#
# return instance
def deserialize_model(data, klass):
"""Deserializes list or dict to model.
......
wheel==0.34.2
flask-testing==0.8.0
coverage==5.0.3
coverage==5.0.4
nose>=1.3.7
pluggy>=0.13.1
randomize>=0.14
......
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
if [ "x(venv3-7) " != x ] ; then
PS1="(venv3-7) ${PS1:-}"
else
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
fi
fi
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
if ("venv3-7" != "") then
set env_name = "venv3-7"
else
if (`basename "VIRTUAL_ENV"` == "__") then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
else
set env_name = `basename "$VIRTUAL_ENV"`
endif
endif
set prompt = "[$env_name] $prompt"
unset env_name
endif
alias pydoc python -m pydoc
rehash
# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
# you cannot run it directly
function deactivate -d "Exit virtualenv and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
set -e VIRTUAL_ENV
if test "$argv[1]" != "nondestructive"
# Self destruct!
functions -e deactivate
end
end
# unset irrelevant variables
deactivate nondestructive
set -gx VIRTUAL_ENV "/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# unset PYTHONHOME if set
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# save the current fish_prompt function as the function _old_fish_prompt
functions -c fish_prompt _old_fish_prompt
# with the original prompt function renamed, we can override with our own.
function fish_prompt
# Save the return status of the last command
set -l old_status $status
# Prompt override?
if test -n "(venv3-7) "
printf "%s%s" "(venv3-7) " (set_color normal)
else
# ...Otherwise, prepend env
set -l _checkbase (basename "$VIRTUAL_ENV")
if test $_checkbase = "__"
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal)
else
printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal)
end
end
# Restore the return status of the previous command.
echo "exit $old_status" | .
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from chardet.cli.chardetect import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from connexion.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from coverage.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from coverage.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from coverage.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==40.8.0', 'console_scripts', 'easy_install')()
)
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install-3.7'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==40.8.0', 'console_scripts', 'easy_install-3.7')()
)
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from flask.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jsonschema.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from nose import run_exit
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(run_exit())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from nose import run_exit
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(run_exit())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from openapi_spec_validator.__main__ import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pbr.cmd.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip')()
)
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3')()
)
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3.7'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3.7')()
)
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from babel.messages.frontend import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
python3.7
\ No newline at end of file
python3.7
\ No newline at end of file
/usr/bin/python3.7
\ No newline at end of file
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from toscaparser.shell import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
#!/home/alogo/workspace/DRIP/sure_tosca-flask-server/venv3-7/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from wheel.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
.\" Man page generated from reStructuredText.
.
.TH "NOSETESTS" "1" "April 04, 2015" "1.3" "nose"
.SH NAME
nosetests \- Nicer testing for Python
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH NICER TESTING FOR PYTHON
.SS SYNOPSIS
.INDENT 0.0
.INDENT 3.5
nosetests [options] [names]
.UNINDENT
.UNINDENT
.SS DESCRIPTION
.sp
nose collects tests automatically from python source files,
directories and packages found in its working directory (which
defaults to the current working directory). Any python source file,
directory or package that matches the testMatch regular expression
(by default: \fI(?:^|[b_.\-])[Tt]est)\fP will be collected as a test (or
source for collection of tests). In addition, all other packages
found in the working directory will be examined for python source files
or directories that match testMatch. Package discovery descends all
the way down the tree, so package.tests and package.sub.tests and
package.sub.sub2.tests will all be collected.
.sp
Within a test directory or package, any python source file matching
testMatch will be examined for test cases. Within a test module,
functions and classes whose names match testMatch and TestCase
subclasses with any name will be loaded and executed as tests. Tests
may use the assert keyword or raise AssertionErrors to indicate test
failure. TestCase subclasses may do the same or use the various
TestCase methods available.
.sp
\fBIt is important to note that the default behavior of nose is to
not include tests from files which are executable.\fP To include
tests from such files, remove their executable bit or use
the \-\-exe flag (see \(aqOptions\(aq section below).
.SS Selecting Tests
.sp
To specify which tests to run, pass test names on the command line:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
nosetests only_test_this.py
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Test names specified may be file or module names, and may optionally
indicate the test case to run by separating the module or file name
from the test case name with a colon. Filenames may be relative or
absolute. Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
nosetests test.module
nosetests another.test:TestCase.test_method
nosetests a.test:TestCase
nosetests /path/to/test/file.py:test_function
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You may also change the working directory where nose looks for tests
by using the \-w switch:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
nosetests \-w /path/to/tests
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note, however, that support for multiple \-w arguments is now deprecated
and will be removed in a future release. As of nose 0.10, you can get
the same behavior by specifying the target directories \fIwithout\fP
the \-w switch:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
nosetests /path/to/tests /another/path/to/tests
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Further customization of test selection and loading is possible
through the use of plugins.
.sp
Test result output is identical to that of unittest, except for
the additional features (error classes, and plugin\-supplied
features such as output capture and assert introspection) detailed
in the options below.
.SS Configuration
.sp
In addition to passing command\-line options, you may also put
configuration options in your project\(aqs \fIsetup.cfg\fP file, or a .noserc
or nose.cfg file in your home directory. In any of these standard
ini\-style config files, you put your nosetests configuration in a
\fB[nosetests]\fP section. Options are the same as on the command line,
with the \-\- prefix removed. For options that are simple switches, you
must supply a value:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[nosetests]
verbosity=3
with\-doctest=1
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
All configuration files that are found will be loaded and their
options combined. You can override the standard config file loading
with the \fB\-c\fP option.
.SS Using Plugins
.sp
There are numerous nose plugins available via easy_install and
elsewhere. To use a plugin, just install it. The plugin will add
command line options to nosetests. To verify that the plugin is installed,
run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
nosetests \-\-plugins
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can add \-v or \-vv to that command to show more information
about each plugin.
.sp
If you are running nose.main() or nose.run() from a script, you
can specify a list of plugins to use by passing a list of plugins
with the plugins keyword argument.
.SS 0.9 plugins
.sp
nose 1.0 can use SOME plugins that were written for nose 0.9. The
default plugin manager inserts a compatibility wrapper around 0.9
plugins that adapts the changed plugin api calls. However, plugins
that access nose internals are likely to fail, especially if they
attempt to access test case or test suite classes. For example,
plugins that try to determine if a test passed to startTest is an
individual test or a suite will fail, partly because suites are no
longer passed to startTest and partly because it\(aqs likely that the
plugin is trying to find out if the test is an instance of a class
that no longer exists.
.SS 0.10 and 0.11 plugins
.sp
All plugins written for nose 0.10 and 0.11 should work with nose 1.0.
.SS Options
.INDENT 0.0
.TP
.B \-V, \-\-version
Output nose version and exit
.UNINDENT
.INDENT 0.0
.TP
.B \-p, \-\-plugins
Output list of available plugins and exit. Combine with higher verbosity for greater detail
.UNINDENT
.INDENT 0.0
.TP
.B \-v=DEFAULT, \-\-verbose=DEFAULT
Be more verbose. [NOSE_VERBOSE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-verbosity=VERBOSITY
Set verbosity; \-\-verbosity=2 is the same as \-v
.UNINDENT
.INDENT 0.0
.TP
.B \-q=DEFAULT, \-\-quiet=DEFAULT
Be less verbose
.UNINDENT
.INDENT 0.0
.TP
.B \-c=FILES, \-\-config=FILES
Load configuration from config file(s). May be specified multiple times; in that case, all config files will be loaded and combined
.UNINDENT
.INDENT 0.0
.TP
.B \-w=WHERE, \-\-where=WHERE
Look for tests in this directory. May be specified multiple times. The first directory passed will be used as the working directory, in place of the current working directory, which is the default. Others will be added to the list of tests to execute. [NOSE_WHERE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-py3where=PY3WHERE
Look for tests in this directory under Python 3.x. Functions the same as \(aqwhere\(aq, but only applies if running under Python 3.x or above. Note that, if present under 3.x, this option completely replaces any directories specified with \(aqwhere\(aq, so the \(aqwhere\(aq option becomes ineffective. [NOSE_PY3WHERE]
.UNINDENT
.INDENT 0.0
.TP
.B \-m=REGEX, \-\-match=REGEX, \-\-testmatch=REGEX
Files, directories, function names, and class names that match this regular expression are considered tests. Default: (?:^|[b_./\-])[Tt]est [NOSE_TESTMATCH]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-tests=NAMES
Run these tests (comma\-separated list). This argument is useful mainly from configuration files; on the command line, just pass the tests to run as additional arguments with no switch.
.UNINDENT
.INDENT 0.0
.TP
.B \-l=DEFAULT, \-\-debug=DEFAULT
Activate debug logging for one or more systems. Available debug loggers: nose, nose.importer, nose.inspector, nose.plugins, nose.result and nose.selector. Separate multiple names with a comma.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-debug\-log=FILE
Log debug messages to this file (default: sys.stderr)
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logging\-config=FILE, \-\-log\-config=FILE
Load logging config from this file \-\- bypasses all other logging config settings.
.UNINDENT
.INDENT 0.0
.TP
.B \-I=REGEX, \-\-ignore\-files=REGEX
Completely ignore any file that matches this regular expression. Takes precedence over any other settings or plugins. Specifying this option will replace the default setting. Specify this option multiple times to add more regular expressions [NOSE_IGNORE_FILES]
.UNINDENT
.INDENT 0.0
.TP
.B \-e=REGEX, \-\-exclude=REGEX
Don\(aqt run tests that match regular expression [NOSE_EXCLUDE]
.UNINDENT
.INDENT 0.0
.TP
.B \-i=REGEX, \-\-include=REGEX
This regular expression will be applied to files, directories, function names, and class names for a chance to include additional tests that do not match TESTMATCH. Specify this option multiple times to add more regular expressions [NOSE_INCLUDE]
.UNINDENT
.INDENT 0.0
.TP
.B \-x, \-\-stop
Stop running tests after the first error or failure
.UNINDENT
.INDENT 0.0
.TP
.B \-P, \-\-no\-path\-adjustment
Don\(aqt make any changes to sys.path when loading tests [NOSE_NOPATH]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-exe
Look for tests in python modules that are executable. Normal behavior is to exclude executable modules, since they may not be import\-safe [NOSE_INCLUDE_EXE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-noexe
DO NOT look for tests in python modules that are executable. (The default on the windows platform is to do so.)
.UNINDENT
.INDENT 0.0
.TP
.B \-\-traverse\-namespace
Traverse through all path entries of a namespace package
.UNINDENT
.INDENT 0.0
.TP
.B \-\-first\-package\-wins, \-\-first\-pkg\-wins, \-\-1st\-pkg\-wins
nose\(aqs importer will normally evict a package from sys.modules if it sees a package with the same name in a different location. Set this option to disable that behavior.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-byte\-compile
Prevent nose from byte\-compiling the source into .pyc files while nose is scanning for and running tests.
.UNINDENT
.INDENT 0.0
.TP
.B \-a=ATTR, \-\-attr=ATTR
Run only tests that have attributes specified by ATTR [NOSE_ATTR]
.UNINDENT
.INDENT 0.0
.TP
.B \-A=EXPR, \-\-eval\-attr=EXPR
Run only tests for whose attributes the Python expression EXPR evaluates to True [NOSE_EVAL_ATTR]
.UNINDENT
.INDENT 0.0
.TP
.B \-s, \-\-nocapture
Don\(aqt capture stdout (any stdout output will be printed immediately) [NOSE_NOCAPTURE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-nologcapture
Disable logging capture plugin. Logging configuration will be left intact. [NOSE_NOLOGCAPTURE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logging\-format=FORMAT
Specify custom format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGFORMAT]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logging\-datefmt=FORMAT
Specify custom date/time format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGDATEFMT]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logging\-filter=FILTER
Specify which statements to filter in/out. By default, everything is captured. If the output is too verbose,
use this option to filter out needless output.
Example: filter=foo will capture statements issued ONLY to
foo or foo.what.ever.sub but not foobar or other logger.
Specify multiple loggers with comma: filter=foo,bar,baz.
If any logger name is prefixed with a minus, eg filter=\-foo,
it will be excluded rather than included. Default: exclude logging messages from nose itself (\-nose). [NOSE_LOGFILTER]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logging\-clear\-handlers
Clear all other logging handlers
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logging\-level=DEFAULT
Set the log level to capture
.UNINDENT
.INDENT 0.0
.TP
.B \-\-with\-coverage
Enable plugin Coverage:
Activate a coverage report using Ned Batchelder\(aqs coverage module.
[NOSE_WITH_COVERAGE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-package=PACKAGE
Restrict coverage output to selected packages [NOSE_COVER_PACKAGE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-erase
Erase previously collected coverage statistics before run
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-tests
Include test modules in coverage report [NOSE_COVER_TESTS]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-min\-percentage=DEFAULT
Minimum percentage of coverage for tests to pass [NOSE_COVER_MIN_PERCENTAGE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-inclusive
Include all python files under working directory in coverage report. Useful for discovering holes in test coverage if not all files are imported by the test suite. [NOSE_COVER_INCLUSIVE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-html
Produce HTML coverage information
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-html\-dir=DIR
Produce HTML coverage information in dir
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-branches
Include branch coverage in coverage report [NOSE_COVER_BRANCHES]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-xml
Produce XML coverage information
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cover\-xml\-file=FILE
Produce XML coverage information in file
.UNINDENT
.INDENT 0.0
.TP
.B \-\-pdb
Drop into debugger on failures or errors
.UNINDENT
.INDENT 0.0
.TP
.B \-\-pdb\-failures
Drop into debugger on failures
.UNINDENT
.INDENT 0.0
.TP
.B \-\-pdb\-errors
Drop into debugger on errors
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-deprecated
Disable special handling of DeprecatedTest exceptions.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-with\-doctest
Enable plugin Doctest:
Activate doctest plugin to find and run doctests in non\-test modules.
[NOSE_WITH_DOCTEST]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-doctest\-tests
Also look for doctests in test modules. Note that classes, methods and functions should have either doctests or non\-doctest tests, not both. [NOSE_DOCTEST_TESTS]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-doctest\-extension=EXT
Also look for doctests in files with this extension [NOSE_DOCTEST_EXTENSION]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-doctest\-result\-variable=VAR
Change the variable name set to the result of the last interpreter command from the default \(aq_\(aq. Can be used to avoid conflicts with the _() function used for text translation. [NOSE_DOCTEST_RESULT_VAR]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-doctest\-fixtures=SUFFIX
Find fixtures for a doctest file in module with this name appended to the base name of the doctest file
.UNINDENT
.INDENT 0.0
.TP
.B \-\-doctest\-options=OPTIONS
Specify options to pass to doctest. Eg. \(aq+ELLIPSIS,+NORMALIZE_WHITESPACE\(aq
.UNINDENT
.INDENT 0.0
.TP
.B \-\-with\-isolation
Enable plugin IsolationPlugin:
Activate the isolation plugin to isolate changes to external
modules to a single test module or package. The isolation plugin
resets the contents of sys.modules after each test module or
package runs to its state before the test. PLEASE NOTE that this
plugin should not be used with the coverage plugin, or in any other case
where module reloading may produce undesirable side\-effects.
[NOSE_WITH_ISOLATION]
.UNINDENT
.INDENT 0.0
.TP
.B \-d, \-\-detailed\-errors, \-\-failure\-detail
Add detail to error output by attempting to evaluate failed asserts [NOSE_DETAILED_ERRORS]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-with\-profile
Enable plugin Profile:
Use this plugin to run tests using the hotshot profiler.
[NOSE_WITH_PROFILE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-profile\-sort=SORT
Set sort order for profiler output
.UNINDENT
.INDENT 0.0
.TP
.B \-\-profile\-stats\-file=FILE
Profiler stats file; default is a new temp file on each run
.UNINDENT
.INDENT 0.0
.TP
.B \-\-profile\-restrict=RESTRICT
Restrict profiler output. See help for pstats.Stats for details
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-skip
Disable special handling of SkipTest exceptions.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-with\-id
Enable plugin TestId:
Activate to add a test id (like #1) to each test name output. Activate
with \-\-failed to rerun failing tests only.
[NOSE_WITH_ID]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-id\-file=FILE
Store test ids found in test runs in this file. Default is the file .noseids in the working directory.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-failed
Run the tests that failed in the last test run.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-processes=NUM
Spread test run among this many processes. Set a number equal to the number of processors or cores in your machine for best results. Pass a negative number to have the number of processes automatically set to the number of cores. Passing 0 means to disable parallel testing. Default is 0 unless NOSE_PROCESSES is set. [NOSE_PROCESSES]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-process\-timeout=SECONDS
Set timeout for return of results from each test runner process. Default is 10. [NOSE_PROCESS_TIMEOUT]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-process\-restartworker
If set, will restart each worker process once their tests are done, this helps control memory leaks from killing the system. [NOSE_PROCESS_RESTARTWORKER]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-with\-xunit
Enable plugin Xunit: This plugin provides test results in the standard XUnit XML format. [NOSE_WITH_XUNIT]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-xunit\-file=FILE
Path to xml file to store the xunit report in. Default is nosetests.xml in the working directory [NOSE_XUNIT_FILE]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-xunit\-testsuite\-name=PACKAGE
Name of the testsuite in the xunit xml, generated by plugin. Default test suite name is nosetests.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-all\-modules
Enable plugin AllModules: Collect tests from all python modules.
[NOSE_ALL_MODULES]
.UNINDENT
.INDENT 0.0
.TP
.B \-\-collect\-only
Enable collect\-only:
Collect and output test names only, don\(aqt run any tests.
[COLLECT_ONLY]
.UNINDENT
.SH AUTHOR
Nose developers
.SH COPYRIGHT
2009, Jason Pellerin
.\" Generated by docutils manpage writer.
.
home = /usr/bin
include-system-site-packages = false
version = 3.7.5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment