Search in sources :

Example 1 with TypeAttribute

use of com.spectralogic.ds3autogen.python.model.type.TypeAttribute in project ds3_autogen by SpectraLogic.

the class BaseTypeGenerator_Test method toAttribute_Test.

@Test
public void toAttribute_Test() {
    final TypeAttribute result = toAttribute(createDs3ElementAttribute());
    assertThat(result.toPythonCode(), is("'Attribute'"));
}
Also used : TypeAttribute(com.spectralogic.ds3autogen.python.model.type.TypeAttribute) Test(org.junit.Test)

Example 2 with TypeAttribute

use of com.spectralogic.ds3autogen.python.model.type.TypeAttribute in project ds3_autogen by SpectraLogic.

the class PythonFunctionalTests method simpleType.

@Test
public void simpleType() throws TemplateModelException, IOException {
    final String modelDescriptorName = "TestElementsType";
    final FileUtils fileUtils = mock(FileUtils.class);
    final TestPythonGeneratedCode codeGenerator = new TestPythonGeneratedCode(fileUtils);
    codeGenerator.generateCode(fileUtils, "/input/types/simpleType.xml");
    final String ds3Code = codeGenerator.getDs3Code();
    CODE_LOGGER.logFile(ds3Code, FileTypeToLog.MODEL_PARSERS);
    assertTrue(hasContent(ds3Code));
    final ImmutableList<TypeContent> modelContents = ImmutableList.of(new TypeAttribute("InCache"), new TypeElement("MyBucket", "BucketDetails"), new TypeElement("ByteOffset", "None"), new TypeElementList("MyBucketList", "None", "BucketDetails"), new TypeElementList("Pool", "Pools", "None"));
    hasModelDescriptor(modelDescriptorName, modelContents, ds3Code);
}
Also used : TypeAttribute(com.spectralogic.ds3autogen.python.model.type.TypeAttribute) FileUtils(com.spectralogic.ds3autogen.api.FileUtils) TypeElement(com.spectralogic.ds3autogen.python.model.type.TypeElement) TypeContent(com.spectralogic.ds3autogen.python.model.type.TypeContent) TestPythonGeneratedCode(com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Test(org.junit.Test)

Aggregations

TypeAttribute (com.spectralogic.ds3autogen.python.model.type.TypeAttribute)2 Test (org.junit.Test)2 FileUtils (com.spectralogic.ds3autogen.api.FileUtils)1 TypeContent (com.spectralogic.ds3autogen.python.model.type.TypeContent)1 TypeElement (com.spectralogic.ds3autogen.python.model.type.TypeElement)1 TypeElementList (com.spectralogic.ds3autogen.python.model.type.TypeElementList)1 TestPythonGeneratedCode (com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode)1