Ejemplo n.º 1
0
    def test_can_pin(self):
        config = Config()
        config.requirements = [RequirementConfig(path="foo.txt", pin=False)]

        self.assertEqual(config.can_pin("foo.txt"), False)

        config.pin = False
        config.requirements[0].pin = True

        self.assertEqual(config.can_pin("foo.txt"), True)

        self.assertEqual(config.can_pin("other.txt"), False)
Ejemplo n.º 2
0
    def test_pin_file(self):
        config = Config()
        config.requirements = [
            RequirementConfig(path="foo.txt", pin=False)
        ]

        self.assertEqual(config.pin_file("foo.txt"), False)

        config.pin = False
        config.requirements[0].pin = True

        self.assertEqual(config.pin_file("foo.txt"), True)

        self.assertEqual(config.pin_file("other.txt"), False)
Ejemplo n.º 3
0
    def test_can_update_all(self):
        config = Config()
        config.requirements = [
            RequirementConfig(path="foo.txt", update="insecure")
        ]

        self.assertEqual(config.can_update_all("foo.txt"), False)

        config.update = "insecure"
        config.requirements[0].update = "all"

        self.assertEqual(config.can_update_all("foo.txt"), True)

        self.assertEqual(config.can_update_all("other.txt"), False)
Ejemplo n.º 4
0
    def test_can_update_all(self):
        config = Config()
        config.requirements = [
            RequirementConfig(path="foo.txt", update="insecure")
        ]

        self.assertEqual(config.can_update_all("foo.txt"), False)

        config.update = "insecure"
        config.requirements[0].update = "all"

        self.assertEqual(config.can_update_all("foo.txt"), True)

        self.assertEqual(config.can_update_all("other.txt"), False)