Skip to content

Instantly share code, notes, and snippets.

@kilon
Created March 30, 2018 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kilon/f717f874e829b875b734aaa5eae713d9 to your computer and use it in GitHub Desktop.
Save kilon/f717f874e829b875b734aaa5eae713d9 to your computer and use it in GitHub Desktop.
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