Skip to content

Commit

Permalink
Test Pes Stop, Load/Save
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize committed Jul 17, 2019
1 parent 21e8fd2 commit 55c5628
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,25 @@ def test_write_pes_mismatched(self):
write_pes(pattern, file1)
self.addCleanup(os.remove, file1)

def test_pes_writes_stop(self):
"""Test if pes can read/write a stop command."""
file1 = "file.pes"
pattern = EmbPattern()
pattern += "red"
pattern += (0, 0), (100, 100)
pattern += STOP
pattern += (100, 0), (0, 100)
pattern += "blue"
pattern += (0, 0), (100, 100)
pattern += STOP
pattern += (100, 0), (0, 100)
write_pes(pattern, file1, {"version": "6t"})
loaded = read_pes(file1)
self.assertEqual(pattern.count_stitch_commands(STOP), 2)
self.assertEqual(pattern.count_stitch_commands(COLOR_CHANGE), 1)
self.assertEqual(pattern.count_threads(), 2)
self.assertEqual(loaded.count_stitch_commands(STOP), 2)
self.assertEqual(loaded.count_stitch_commands(COLOR_CHANGE), 1)
self.assertEqual(loaded.count_threads(), 2)
self.addCleanup(os.remove, file1)

0 comments on commit 55c5628

Please sign in to comment.