def test_check_diff_as_arg_test_empty_file(self, mock_comp): js = SnapAdmin() js.args.diff = True js.args.pre_snapfile = "first_file.xml" js.args.post_snapfile = "second_file.xml" js.check_diff_as_arg() self.assertFalse(mock_comp.called)
def test_check_diff_as_arg_test_file(self, mock_comp, mock_exit): js = SnapAdmin() js.args.diff = True js.args.pre_snapfile = os.path.join(os.path.dirname(__file__), 'configs', '1.1.1.1_snap_not-range_pre_show_chassis_fpc.xml') js.args.post_snapfile = os.path.join(os.path.dirname(__file__), 'configs', '1.1.1.1_snap_is-lt_pre_show_chassis_fpc.xml') js.check_diff_as_arg() self.assertTrue(mock_comp.called)