def _setup(self): inst = PathSegment({}) inst.get_all_iftokens = create_mock_full(return_value=("t0", "t1")) h = create_mock_full({ 'update()': None, 'digest()': "digest", 'hexdigest()': "hexdigest" }) return inst, h
def test(self, _): asms = [] for i in range(3): pcbms = [] for j in range(2): pcbms.append( create_mock_full({"igRevToken": "ig %d %d" % (i, j)})) asms.append( create_mock_full({ "pcbms": pcbms, "egRevToken": "eg %d" % i })) inst = PathSegment(create_mock_full({"asms": asms})) expected = [ 'ig 0 0', 'ig 0 1', 'eg 0', 'ig 1 0', 'ig 1 1', 'eg 1', 'ig 2 0', 'ig 2 1', 'eg 2' ] # Call ntools.eq_(inst.get_all_iftokens(), expected)