예제 #1
0
    def test_ignored(self):

        f = RoutePolicy(device=self.device)
        g = RoutePolicy(device=self.device)


        f.maker.outputs[ShowRouteMapAll] = \
            {'':RoutePolicyOutput.showRouteMapAll}

        g.maker.outputs[ShowRouteMapAll] = \
            {'':RoutePolicyOutput.showRouteMapAll}

        f.learn()
        g.learn()

        f.diff_ignore.append(
            'info[test][statements][10][actions][set_route_origin][origin]')

        self.assertNotEqual(f, g)
        # Verify diff now
        diff = f.diff(g)
        sorted_diff = str(diff)
        sorted_result = (
            '''+diff_ignore: deque(['maker', 'callables', 'device', 'info[test][statements][10][actions][set_route_origin][origin]'])\n-diff_ignore: deque(['maker', 'callables', 'device'])'''
        )
        self.assertEqual(sorted_diff, sorted_result)
예제 #2
0
    def test_ignored(self):

        f = RoutePolicy(device=self.device)
        g = RoutePolicy(device=self.device)


        f.maker.outputs[ShowRouteMapAll] = \
            {'':RoutePolicyOutput.showRouteMapAll}

        g.maker.outputs[ShowRouteMapAll] = \
            {'':RoutePolicyOutput.showRouteMapAll}

        f.learn()
        g.learn()

        f.s = 2

        self.assertNotEqual(f,g)
        # Verify diff now
        diff = f.diff(g)
        sorted_diff = str(diff)
        sorted_result = ('+s: 2')
        self.assertEqual(sorted_diff,sorted_result)