Created
March 30, 2018 22:14
-
-
Save kilon/f717f874e829b875b734aaa5eae713d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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