use of org.jetbrains.plugins.ipnb.format.IpnbFile in project intellij-community by JetBrains.
the class JsonParserTest method testFile.
public void testFile() throws IOException {
final String fileName = "testData/SymPy.ipynb";
final String fileText = IpnbTestCase.getFileText(fileName);
final IpnbFile ipnbFile = IpnbParser.parseIpnbFile(fileText, new LightVirtualFile());
assertNotNull(ipnbFile);
assertEquals(31, ipnbFile.getCells().size());
}
use of org.jetbrains.plugins.ipnb.format.IpnbFile in project intellij-community by JetBrains.
the class JsonParserTest method testMarkdownCells.
public void testMarkdownCells() throws IOException {
final String fileName = "testData/SymPy.ipynb";
final String fileText = IpnbTestCase.getFileText(fileName);
final IpnbFile ipnbFile = IpnbParser.parseIpnbFile(fileText, new LightVirtualFile());
assertNotNull(ipnbFile);
final List<IpnbCell> cells = ipnbFile.getCells();
Iterables.removeIf(cells, new Predicate<IpnbCell>() {
@Override
public boolean apply(IpnbCell cell) {
return !(cell instanceof IpnbMarkdownCell);
}
});
assertEquals(7, cells.size());
}
Aggregations