Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class TestMorpheasMorphBounds(unittest.TestCase, livecoding.LiveObject ):
instances = []
def setUp(self):
self.world = morpheas.World()
self.tmorph = morpheas.Morph()
self.world.add_morph(self.tmorph)
def test_1_morph_width(self):
self.tmorph.width = 100
self.assertEqual(self.tmorph.width, 100)
print("parent tmorph width: ", self.tmorph.parent.width)
def test_2_morph_default_position(self):
self.assertEqual(self.tmorph.position, [0,0])
def test_3_morph_change_position(self):
self.tmorph.position = [100,100]
self.assertEqual(self.tmorph.position, [100, 100])
def test_4_morph_parent_is_world(self):
self.assertEqual(self.tmorph.parent,self.world)
def test_5_morph_world_is_world(self):
self.assertEqual(self.tmorph.world, self.world)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.