source: java2python/junit-t/src/main/java/tudelft/utilities/j2p/t/unittest/TestCase.java

Last change on this file was 896, checked in by wouter, 5 months ago

#310 moved GetResourcesTest to junit-t because this test is so much easier if we have junit translator and package translation. junit tests now require @RunWith annotation for proper translation. Added more translators

File size: 617 bytes
Line 
1package tudelft.utilities.j2p.t.unittest;
2
3import com.github.javaparser.ast.type.Type;
4
5import tudelft.utilities.j2p.formatting.ExpressionLine;
6import tudelft.utilities.j2p.t.TranslationException;
7import tudelft.utilities.j2p.t.java.lang.Object;
8
9/**
10 * This is a translator for the "fake" org.junit.TestCase class that helps us
11 * make the testcase extend "unittest.TestCase" in python.
12 *
13 */
14public class TestCase extends Object {
15 @Override
16 public ExpressionLine getTypeExpr(Type type) throws TranslationException {
17 return new ExpressionLine("TestCase")
18 .withImport("from unittest import TestCase");
19 }
20
21}
Note: See TracBrowser for help on using the repository browser.