Skip to content

Commit

Permalink
Fix the python stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller committed Mar 11, 2020
1 parent 4cd2e17 commit bbb7406
Show file tree
Hide file tree
Showing 20 changed files with 8,342 additions and 8,087 deletions.
30 changes: 16 additions & 14 deletions packages/@jsii/python-runtime/tests/test_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@
from json import loads

from jsii_calc import (
AbstractClassReturner,
AbstractSuite,
Add,
Calculator,
IFriendlier,
IFriendlyRandomGenerator,
IRandomNumberGenerator,
Multiply,
Negate,
Power,
Sum,
)
from jsii_calc.compliance import (
AbstractClassReturner,
AllTypes,
AllTypesEnum,
AmbiguousParameters,
AsyncVirtualMethods,
Bell,
Calculator,
ClassWithPrivateConstructorAndAutomaticProperties,
ConfusingToJackson,
ConsumerCanRingBell,
Expand All @@ -31,33 +40,25 @@
GreetingAugmenter,
IBellRinger,
IConcreteBellRinger,
IFriendlier,
IFriendlyRandomGenerator,
IRandomNumberGenerator,
InterfaceCollections,
IInterfaceWithProperties,
IStructReturningDelegate,
JsiiAgent,
JSObjectLiteralForInterface,
JSObjectLiteralToNative,
JsonFormatter,
Multiply,
Negate,
NodeStandardLibrary,
NullShouldBeTreatedAsUndefined,
NumberGenerator,
ObjectWithPropertyProvider,
PartiallyInitializedThisConsumer,
Polymorphism,
Power,
PythonReservedWords,
ReferenceEnumFromScopedPackage,
ReturnsPrivateImplementationOfInterface,
Statics,
Sum,
SyncVirtualMethods,
UsesInterfaceWithProperties,
composition,
EraseUndefinedHashValues,
EraseUndefinedHashValuesOptions,
VariadicMethod,
Expand All @@ -70,7 +71,10 @@
StructUnionConsumer,
SomeTypeJsii976,
StructParameterType,
AnonymousImplementationProvider
AnonymousImplementationProvider,
)
from jsii_calc.composition import (
CompositeOperation
)
from scope.jsii_calc_lib import IFriendly, EnumFromScopedModule, Number

Expand Down Expand Up @@ -369,8 +373,6 @@ def test_getAndSetEnumValues():
calc.add(9)
calc.pow(3)

CompositeOperation = composition.CompositeOperation

assert calc.string_style == CompositeOperation.CompositionStringStyle.NORMAL

calc.string_style = CompositeOperation.CompositionStringStyle.DECORATED
Expand Down Expand Up @@ -1046,7 +1048,7 @@ def test_return_subclass_that_implements_interface_976_raises_attributeerror_whe
failed = False
except AttributeError as err:
failed = True
assert err.args[0] == "'<class 'jsii_calc.BaseJsii976'>+<class 'jsii_calc._IReturnJsii976Proxy'>' object has no attribute 'not_a_real_method_I_swear'"
assert err.args[0] == "'<class 'jsii_calc.compliance.BaseJsii976'>+<class 'jsii_calc.compliance._IReturnJsii976Proxy'>' object has no attribute 'not_a_real_method_I_swear'"
assert failed

def test_return_anonymous_implementation_of_interface():
Expand Down
4 changes: 2 additions & 2 deletions packages/@jsii/python-runtime/tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_jsii_error(self):
def test_inheritance_maintained(self):
"""Check that for JSII struct types we can get the inheritance tree in some way."""
# inspect.getmro() won't work because of TypedDict, but we add another annotation
bases = find_struct_bases(jsii_calc.DerivedStruct)
bases = find_struct_bases(jsii_calc.compliance.DerivedStruct)

base_names = [b.__name__ for b in bases]

Expand All @@ -43,4 +43,4 @@ def recurse(s):
recurse(base)

recurse(x)
return ret
return ret
Loading

0 comments on commit bbb7406

Please sign in to comment.