Example #1
0
    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))
Example #2
0
	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) )
Example #3
0
    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))
Example #4
0
	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))
Example #5
0
    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))
Example #6
0
    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))
Example #7
0
    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))
Example #8
0
	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))
Example #9
0
    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))
Example #10
0
	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))
Example #11
0
	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))
Example #12
0
    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))
Example #13
0
	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))