Exemple #1
0
    def test_stage_from_dict(self, mocked_init):

        d = {
            'uid': 're.Stage.0000',
            'name': 's1',
            'state': states.DONE,
            'state_history': [states.INITIAL, states.DONE],
            'parent_pipeline': {
                'uid': 'p1',
                'name': 'pipe1'
            }
        }

        s = Stage()
        s._uid = None
        s._name = None
        s._state = None
        s._state_history = None
        s._p_pipeline = None
        s.from_dict(d)

        self.assertEqual(s._uid, d['uid'])
        self.assertEqual(s._name, d['name'])
        self.assertEqual(s._state, d['state'])
        self.assertEqual(s._state_history, d['state_history'])
        self.assertEqual(s._p_pipeline, d['parent_pipeline'])
def test_stage_from_dict():

    d = {'uid': 're.Stage.0000',
         'name': 's1',
         'state': states.DONE,
         'state_history': [states.INITIAL, states.DONE],
         'parent_pipeline': {'uid': 'p1',
                             'name': 'pipe1'}
         }

    s = Stage()
    s.from_dict(d)

    assert s.uid == d['uid']
    assert s.name == d['name']
    assert s.state == d['state']
    assert s.state_history == d['state_history']
    assert s.parent_pipeline == d['parent_pipeline']
Exemple #3
0
def test_stage_from_dict():

    d = {'uid': 're.Stage.0000',
         'name': 's1',
         'state': states.DONE,
         'state_history': [states.INITIAL, states.DONE],
         'parent_pipeline': {'uid': 'p1',
                             'name': 'pipe1'}
         }

    s = Stage()
    s.from_dict(d)

    assert s.uid == d['uid']
    assert s.name == d['name']
    assert s.state == d['state']
    assert s.state_history == d['state_history']
    assert s.parent_pipeline == d['parent_pipeline']