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'"));
}
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);
}
Aggregations