def test_duplicates_ignored_delete(self): args = MockArgs() args.show_delete = True inp = _gen_state(4, "%Y-%m-%d") self.assertEqual(run(args, inp), run(args, inp * 2))
def test_duplicates_ignored_delete(self): args = MockArgs() args.show_delete = True inp = _gen_state(4, "%Y-%m-%d") self.assertEqual( run(args, inp), run(args, inp*2) )
def test_default_delete(self): args = MockArgs() args.show_delete = True inp = _gen_state(4, "%Y-%m-%d") out = run(args, inp) self.assertEqual(set(["2015-01-02"]), set(out))
def test_default_delete(self): args = MockArgs() args.show_delete = True inp = _gen_state(4, "%Y-%m-%d") out = run(args, inp) self.assertEqual(set([ "2015-01-02"]), set(out))
def test_fuzz(self): args = MockArgs() args.fuzz = 1 args.show_keep = True inp = ["2015-01-01", "2015-01-04"] out = run(args, inp) self.assertEqual(set(inp), set(out))
def test_unsafe_force(self): args = MockArgs() args.show_keep = True args.unsafe = True inp = ["2015-01-01", "2015-01-04"] out = run(args, inp) self.assertEqual(set(["2015-01-01", "2015-01-04"]), set(out))
def test_never_delete_invalid(self): args = MockArgs() args.show_delete = True inp = _gen_state(4, "%Y-%m-%d") inp.append("strange") out = run(args, inp) self.assertEqual(set(["2015-01-02"]), set(out))
def test_never_delete_invalid(self): args = MockArgs() args.show_delete = True inp = _gen_state(4, "%Y-%m-%d") inp.append("strange") out = run(args, inp) self.assertEqual(set([ "2015-01-02"]), set(out))
def test_always_keep_invalid(self): args = MockArgs() args.show_keep = True inp = _gen_state(4, "%Y-%m-%d") inp.append("strange") out = run(args, inp) self.assertEqual( set(["strange", "2015-01-01", "2015-01-03", "2015-01-04"]), set(out))
def test_unsafe_force(self): args = MockArgs() args.show_keep = True args.unsafe = True inp = [ "2015-01-01", "2015-01-04" ] out = run(args, inp) self.assertEqual(set([ "2015-01-01", "2015-01-04"]), set(out))
def test_always_keep_invalid(self): args = MockArgs() args.show_keep = True inp = _gen_state(4, "%Y-%m-%d") inp.append("strange") out = run(args, inp) self.assertEqual(set([ "strange", "2015-01-01", "2015-01-03", "2015-01-04"]), set(out))
def test_skip_keep(self): args = MockArgs() args.show_keep = True args.skip = 3 inp = _gen_state(7, "%Y-%m-%d") out = run(args, inp) self.assertEqual( set([ "2015-01-01", "2015-01-03", "2015-01-04", "2015-01-05", "2015-01-06", "2015-01-07" ]), set(out))
def test_skip_keep(self): args = MockArgs() args.show_keep = True args.skip = 3 inp = _gen_state(7, "%Y-%m-%d") out = run(args, inp) self.assertEqual(set([ "2015-01-01", "2015-01-03", "2015-01-04", "2015-01-05", "2015-01-06", "2015-01-07"]), set(out))