def test_write(self): # SETUP expected_report = """\ create_line 0 0 100 0 fill='black' pensize=1 create_text 100 0 anchor='sw' fill='black' font=('Arial', 8, 'normal') text='Bob' """ # EXEC t = MockTurtle() t.fd(100) t.write('Bob') report = t.report # VERIFY self.assertEqual(expected_report.splitlines(), report)
def test_write_right(self): # SETUP expected_report = """\ create_line 0 0 100 0 fill='black' pensize=1 create_text 100 0 anchor='se' fill='black' font=('Arial', 8, 'normal') text='Bob' """ # EXEC t = MockTurtle() t.fd(100) t.write('Bob', align='right') report = t.report # VERIFY self.assertEqual(expected_report.splitlines(), report)
def test_write_move(self): """ Not supported yet """ t = MockTurtle() with self.assertRaises(NotImplementedError): t.write('Bob', move=True)