コード例 #1
0
    def test_ExtruderStateCopy(self):
        # create a new state
        state = ExtruderState()
        # change all the default values

        state.E = 1
        state.extrusion_length = 100
        state.extruder_length_total = 200
        state.retraction_length = 300
        state.deretraction_length = 400
        state.is_extruding_start = True
        state.is_extruding = True
        state.is_primed = True
        state.is_retracting_start = True
        state.is_retracting = True
        state.is_partially_retracted = True
        state.is_retracted = True
        state.is_deretracting_start = True
        state.is_deretracting = True
        state.is_deretracted = True
        state.has_changed = True

        # copy to a new state
        new_state = ExtruderState(state)
        # verify the state was copied correctly
        self.assertEquals(new_state.E, 1)
        self.assertEquals(new_state.extrusion_length, 100)
        self.assertEquals(new_state.extruder_length_total, 200)
        self.assertEquals(new_state.retraction_length, 300)
        self.assertEquals(new_state.deretraction_length, 400)
        self.assertTrue(new_state.is_extruding_start)
        self.assertTrue(new_state.is_extruding)
        self.assertTrue(new_state.is_primed)
        self.assertTrue(new_state.is_retracting_start)
        self.assertTrue(new_state.is_retracting)
        self.assertTrue(new_state.is_partially_retracted)
        self.assertTrue(new_state.is_retracted)
        self.assertTrue(new_state.is_deretracting_start)
        self.assertTrue(new_state.is_deretracting)
        self.assertTrue(new_state.is_deretracted)
        self.assertTrue(new_state.has_changed)
コード例 #2
0
ファイル: test_extruder.py プロジェクト: woebbi/Octolapse
    def test_ExtruderStateCopy(self):
        # create a new state
        state = ExtruderState()
        # change all the default values

        state.E = 1
        state.ExtrusionLength = 100
        state.ExtrusionLengthTotal = 200
        state.RetractionLength = 300
        state.DetractionLength = 400
        state.IsExtrudingStart = True
        state.IsExtruding = True
        state.IsPrimed = True
        state.IsRetractingStart = True
        state.IsRetracting = True
        state.IsPartiallyRetracted = True
        state.IsRetracted = True
        state.IsDetractingStart = True
        state.IsDetracting = True
        state.IsDetracted = True
        state.HasChanged = True

        # copy to a new state
        new_state = ExtruderState(state)
        # verify the state was copied correctly
        self.assertEquals(new_state.E, 1)
        self.assertEquals(new_state.ExtrusionLength, 100)
        self.assertEquals(new_state.ExtrusionLengthTotal, 200)
        self.assertEquals(new_state.RetractionLength, 300)
        self.assertEquals(new_state.DetractionLength, 400)
        self.assertTrue(new_state.IsExtrudingStart)
        self.assertTrue(new_state.IsExtruding)
        self.assertTrue(new_state.IsPrimed)
        self.assertTrue(new_state.IsRetractingStart)
        self.assertTrue(new_state.IsRetracting)
        self.assertTrue(new_state.IsPartiallyRetracted)
        self.assertTrue(new_state.IsRetracted)
        self.assertTrue(new_state.IsDetractingStart)
        self.assertTrue(new_state.IsDetracting)
        self.assertTrue(new_state.IsDetracted)
        self.assertTrue(new_state.HasChanged)