예제 #1
0
    def test_update_all_restricted_in_file(self):
        self.assertTrue(self.update.should_update(self.req1, self.req_file))

        self.config.requirements = [
            RequirementConfig(path="requirements.txt", update="insecure")
        ]
        self.assertFalse(self.update.should_update(self.req1, self.req_file))
예제 #2
0
파일: test_bot.py 프로젝트: wlmgithub/pyup
 def test_requirement_in_config(self):
     bot = bot_factory()
     bot.config.search = False
     bot.config.requirements = [RequirementConfig(path="foo.txt")]
     bot.add_requirement_file = Mock()
     bot.get_all_requirements()
     self.assertEqual(bot.add_requirement_file.called, True)
     bot.add_requirement_file.assert_called_once_with("foo.txt")
예제 #3
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)
예제 #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)
예제 #5
0
파일: test_config.py 프로젝트: pyupio/pyup
 def test_repr(self):
     config = RequirementConfig(path="foo.txt")
     self.assertEqual(config.__repr__(), str(config.__dict__))
예제 #6
0
 def test_repr(self):
     config = RequirementConfig(path="foo.txt")
     self.assertEqual(config.__repr__(), str(config.__dict__))